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地址?有待进一步研究。
推荐阅读
-
Navicat怎么连接PostgreSQL数据库?Navicat Premium新建连接PostgreSQL数据库教程
-
C#学习--Oracle数据库基本操作(连接、增、删、改、查)封装
-
如何远程连接SQL Server数据库图文教程
-
使用数据库客户端工具Oracle SQL Developer加载第三方驱动连接mysql的方法
-
Linux下PHP连接Oracle数据库
-
OracleXE112Win64位Navicat连接数据库提示错误怎么解决?
-
Oracle数据库远程导入、导出
-
Oracle数据库连接及操作
-
JavaScript基于activexobject连接远程数据库SQL Server 2014的方法
-
解决Navicat连接远程MySQL很慢的方法