Navicat Premium12远程连接oracle数据库

搞我到心态爆炸

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

其实就是oci版本问题

Navicat Premium12远程连接oracle数据库_第1张图片

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

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

安装时选择:

Navicat Premium12远程连接oracle数据库_第2张图片

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

Navicat Premium12远程连接oracle数据库_第3张图片

配置本地网络服务名:

Navicat Premium12远程连接oracle数据库_第4张图片

网络服务名即数据库名,主机名为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文件,

= [ (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=) ] 
		(PROTOCOL=tcp)
		(HOST=)
		(PORT=)
	      )
	      [ (ADDRESS=
		  (PROTOCOL=ipc)
		  (KEY=)	
		)
	      ]
	      [ (ADDRESS=
		  [ (COMMUNITY=) ]
		  (PROTOCOL=decnet)
		  (NODE=)
		  (OBJECT=)
		)
	      ]
              ... # More addresses
	    [ ) ] # Optional depending on whether ADDRESS_LIST is used or not 
	    [ (CONNECT_DATA=
		(SID=)
		[ (GLOBAL_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=) ]
		(PROTOCOL=tcp)
		(HOST=)
		(PORT=)
	      )
	      [ (ADDRESS=
		  (PROTOCOL=ipc)
		  (KEY=)
	         )
	      ]
	      ... 		# More addresses
	    [ ) ] 		# Optional depending on whether ADDRESS_LIST  
				# is being used
	    [ (CONNECT_DATA=
		(SID=)
		[ (GLOBAL_NAME=) ]
	      )
	    ]
	    [ (SOURCE_ROUTE=yes) ]
	  )
	  [ (CONNECT_DATA=
	      (SID=)
	      [ (GLOBAL_NAME=) ]
	    )
	  ]
	  ...   # More descriptions 
	[ ) ]	# Optional depending on whether DESCRIPTION_LIST is used or not

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

 

你可能感兴趣的:(Oracle)