欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

Navicat Premium12远程连接oracle数据库

程序员文章站 2022-04-21 12:02:32
...

搞我到心态爆炸

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

其实就是oci版本问题

Navicat Premium12远程连接oracle数据库

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

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数据库

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

Navicat Premium12远程连接oracle数据库

配置本地网络服务名:

Navicat Premium12远程连接oracle数据库

网络服务名即数据库名,主机名为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地址?有待进一步研究。

 

相关标签: Oracle