文章详情页
some error of the Oracle connection TNS-03505 OR TNS-12541(原创)
(原创)配置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:38Copyright (c) 1997 Oracle Corporation.; All rights reserved.Used parameter files:F:oracleora92networkadmin qlnet.oraUsed HOSTNAME adapter to resolve the aliasAttempting 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.ora100 = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.6.100)(PORT = 1521)) ) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = oracas) ) )完全正确....*******************************************************************或者是C:>tnsping 226TNS Ping Utility for 32-bit Windows: Version 9.2.0.1.0 - Production on 15-OCT-2004 12:40:12Copyright (c) 1997 Oracle Corporation.; All rights reserved.Used parameter files:F:oracleora92networkadmin qlnet.oraTNS-03505: Failed to resolve name(意思是不存在226在文件tnsname.ora中)查看tnsname.ora226 =; (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.6.226)(PORT = 1521)) ) (CONNECT_DATA = (SERVICE_NAME = oracas) ) )完全正确...最后分析出导致上述两个问题的原因都是应为tns前面多了一个空格。。。。。。寒,居然是这种错误...所以大家配置的时候小心细节问题
排行榜