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链接的方式可能不一样。
本文出自 “熔 岩” 博客,请务必保留此出处