Navicat Premium12远程连接oracle数据库

搞我到心态爆炸

现在终于能连上了,mark一下

其实就是oci版本问题

提示各种错误信息,诸如:

navicat is not able to create oci handles

oracle library is not loaded

以上都是oci版本的问题,

可以去官网直接下载oci版本的包,也就是只包含oci的oracle client : https://www.oracle.com/database/technologies/instant-client/downloads.html

注意oci版本是根据远程连接的oracle数据库版本来选择的,

还有第二种,直接去下载完整的oracle client,这个除了包含oci之外,还有可以直接配置oracle数据库,并可测试连接,下载地址:http://www.oracle.com/technetwork/database/enterprise-edition/downloads/112010-win64soft-094461.html

安装时选择:

安装后打开Net Configuratinog Assistent进行配置

配置本地网络服务名:

网络服务名即数据库名,主机名为ip地址,选择tcp连接,之后可以测试连接。

另外oracle client安装目录下:F:\Oracle\11.2.0\product\11.2.0\client_1\network\admin

admin文件夹下有sqlnet.ora文件,按理应当还有tnsnames.oRA文件,但是我的目录下并没有。

可以搂一眼sample中的tnsnames.oRA文件,

<alias>= [ (DESCRIPTION_LIST =  # Optional depending on whether u have 
				# one or more descriptions
				# If there is just one description, unnecessary ]
	  (DESCRIPTION=
	    [ (SDU=2048) ]	# Optional, defaults to 2048
				# Can take values between 512 and 32K
	    [ (ADDRESS_LIST=    # Optional depending on whether u have
				# one or more addresses
				# If there is just one address, unnecessary ]
	      (ADDRESS=
		[ (COMMUNITY=<community_name>) ] 
		(PROTOCOL=tcp)
		(HOST=<hostname>)
		(PORT=<portnumber (1521 is a standard port used)>)
	      )
	      [ (ADDRESS=
		  (PROTOCOL=ipc)
		  (KEY=<ipckey (PNPKEY is a standard key used)>)	
		)
	      ]
	      [ (ADDRESS=
		  [ (COMMUNITY=<community_name>) ]
		  (PROTOCOL=decnet)
		  (NODE=<nodename>)
		  (OBJECT=<objectname>)
		)
	      ]
              ... # More addresses
	    [ ) ] # Optional depending on whether ADDRESS_LIST is used or not 
	    [ (CONNECT_DATA=
		(SID=<oracle_sid>)
		[ (GLOBAL_NAME=<global_database_name>) ]
	      )
	    ]
	    [ (SOURCE_ROUTE=yes) ]  
	  )
	  (DESCRIPTION=     
	    [ (SDU=2048) ]	# Optional, defaults to 2048
				# Can take values between 512 and 32K
	    [ (ADDRESS_LIST= ]	# Optional depending on whether u have more
				# than one address or not
				# If there is just one address, unnecessary
	      (ADDRESS
		[ (COMMUNITY=<community_name>) ]
		(PROTOCOL=tcp)
		(HOST=<hostname>)
		(PORT=<portnumber (1521 is a standard port used)>)
	      )
	      [ (ADDRESS=
		  (PROTOCOL=ipc)
		  (KEY=<ipckey (PNPKEY is a standard key used)>)
	         )
	      ]
	      ... 		# More addresses
	    [ ) ] 		# Optional depending on whether ADDRESS_LIST  
				# is being used
	    [ (CONNECT_DATA=
		(SID=<oracle_sid>)
		[ (GLOBAL_NAME=<global_database_name>) ]
	      )
	    ]
	    [ (SOURCE_ROUTE=yes) ]
	  )
	  [ (CONNECT_DATA=
	      (SID=<oracle_sid>)
	      [ (GLOBAL_NAME=<global_database_name>) ]
	    )
	  ]
	  ...   # More descriptions 
	[ ) ]	# Optional depending on whether DESCRIPTION_LIST is used or not

可以看到HOST ADDRESS PORT这些,也许tnsnames.oRA是相当于手动去配置oracle地址?有待进一步研究。

 

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值