Oracle10g客户端工具plsql链接服务端配置
Oracle10g客户端工具比如plsql,在网络中链接服务端问题比较多中国菜刀,经常出现很多莫名其妙的问题。实际上不是plsql的配置,问题还是出在客户端配置上面,网上有很多的解决办法,并非真正的凑效,下面说一下有效的解决办法:
安装客户端为企业管理器,默认方式安装吧。
安装后需要配置,这个位置位置在:D:\oracle\product\10.2.0\client_1\NETWORK\ADMIN
有两个文件需要配置:
sqlnet.ora
tnsnames.ora
先看tns:
# tnsnames.ora Network Configuration File: d:\oracle\product\10.2.0\client_1\network\admin\tnsnames.ora # Generated by Oracle configuration tools. EXTPROC_CONNECTION_DATA = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0)) ) (CONNECT_DATA = (SID = PLSExtProc) (PRESENTATION = RO) ) ) KFCS = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = 10.87.30.44)(PORT = 1521)) (ADDRESS = (PROTOCOL = TCP)(HOST = 10.87.30.45)(PORT = 1521)) (ADDRESS = (PROTOCOL = TCP)(HOST = 10.87.30.46)(PORT = 1521)) (ADDRESS = (PROTOCOL = TCP)(HOST = 10.87.30.47)(PORT = 1521)) ) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = KFCS) ) ) |
红色部分为服务器端配置的tns,服务名为KFCS
这下注意了,还有个网络服务文件也需要配置:
# sqlnet.ora Network Configuration File: D:\oracle\product\10.2.0\db_1\network\admin\sqlnet.ora # Generated by Oracle configuration tools. # This file is actually generated by netca. But if customers choose to # install "Software Only", this file wont exist and without the native # authentication, they will not be able to connect to the database on NT. SQLNET.AUTHENTICATION_SERVICES= (KFCS) NAMES.DIRECTORY_PATH= (TNSNAMES, EZCONNECT) |
上面的红色服务名要和tns文件中的配置保持一致,否则会有问题。(默认的不对)
默认安装客户端的时候不对。
只要有了这两项配置,你就可以正确的通过plsql链接数据库了。
-----------------------------------------------------------
特别说明下:通过sqlplus命令行链接数据库可能和这个配置无关,具体我试过,感觉sqlplus可以链接成功,就是plsql不成功。感觉sqlplus链接的方式可能不一样。
本文转自 leizhimin 51CTO博客,原文链接:http://blog.51cto.com/lavasoft/1290320,如需转载请自行联系原作者