(原创)配置tnsname是个十分容易的问题,没什么好说的,以前也从来没有错过,不过今天配置的时候出了两个小问题(这两个问题是用gui配置时不会出的,我觉得java启动太慢,手工配置tnsname.ora时出现的)
c:\>tnsping 100
tns ping utility for 32-bit windows: version 9.2.0.1.0 – production on 15-oct-2004 12:38:38
copyright (c) 1997 oracle corporation. all rights reserved.
used parameter files:
f:\oracle\ora92\network\admin qlnet.ora
used hostname adapter to resolve the alias
attempting to contact (description=(connect_data=(sid=*)(service_name=100))(address=(protocol=tcp)(host=100)(port=1521)))
tns-12541: tns:no listener
查看server端的监听,lsnrctl status,结果正常
查看tnsname.ora
100 =
(description =
(address_list =
(address = (protocol = tcp)(host = 192.168.6.100)(port = 1521))
)
(connect_data =
(server = dedicated)
(service_name = oracas)
)
)
完全正确….
*******************************************************************
或者是
c:\>tnsping 226
tns ping utility for 32-bit windows: version 9.2.0.1.0 – production on 15-oct-2004 12:40:12
copyright (c) 1997 oracle corporation. all rights reserved.
used parameter files:
f:\oracle\ora92\network\admin qlnet.ora
tns-03505: failed to resolve name(意思是不存在226在文件tnsname.ora中)
查看tnsname.ora
226 = (description =
(address_list =
(address = (protocol = tcp)(host = 192.168.6.226)(port = 1521))
)
(connect_data =
(service_name = oracas)
)
)
完全正确…
最后分析出导致上述两个问题的原因都是应为tns前面多了一个空格。。。。。。寒,居然是这种错误…
所以大家配置的时候小心细节问题