您好,欢迎访问一九零五行业门户网

TNS-12542 TNS-12560 TNS-00512故障解决

tns-12542 tns-12560 tns-00512故障解决
查看数据库监听状态不对
$ lsnrctl status
lsnrctl for ibm/aix risc system/6000: version 10.2.0.5.0 - production on 05-nov-2012 08:54:08
copyright (c) 1991, 2010, oracle.  all rights reserved.
connecting to (description=(address=(protocol=tcp)(host=test)(port=1521)))
tns-12541: tns:no listener
 tns-12560: tns:protocol adapter error
  tns-00511: no listener
  ibm/aix risc system/6000 error: 79: connection refused
然后手动启动数据库报如下错误:
$ lsnrctl start
lsnrctl for ibm/aix risc system/6000: version 10.2.0.5.0 - production on 05-nov-2012 08:54:12
copyright (c) 1991, 2010, oracle.  all rights reserved.
starting /oracle/product/10.2.0/db_1/bin/tnslsnr: please wait...
tnslsnr for ibm/aix risc system/6000: version 10.2.0.5.0 - production
system parameter file is /oracle/product/10.2.0/db_1/network/admin/listener.ora
log messages written to /oracle/product/10.2.0/db_1/network/log/listener.log
error listening on: (description=(address=(protocol=tcp)(host=test)(port=1521)))
tns-12542: tns:address already in use
 tns-12560: tns:protocol adapter error
  tns-00512: address already in use
  ibm/aix risc system/6000 error: 67: address already in use
listener failed to start. see the error message(s) above...
/oracle/product/10.2.0/db_1/network/trace/listener.trc
明明监听没启动起,,却说已经在运行了,后来终于找到原因,网上看到别人也碰到这个问题,说是hosts文件设置有问题,查看本机主机名和hosts文件,果然有问题,两个ip地址指向了同一个主机名,将一台主机删除后,再启动监听,一切ok。
用root用户进行修改:
# cat /etc/hosts
# internet address      hostname        # comments
# 192.9.200.1          net0sample      # ethernet name/address
# 128.100.0.1          token0sample    # token ring name/address
# 10.2.0.2              x25sample      # x.25 name/address
# 2000:1:1:1:209:6bff:feee:2b7f        ipv6sample      # ipv6 name/address
127.0.0.1              loopback localhost      # loopback (lo0) name/address
192.168.101.189  test
192.168.101.190  test
再次启动监听:
$ lsnrctl start
lsnrctl for ibm/aix risc system/6000: version 10.2.0.5.0 - production on 05-nov-2012 08:58:47
copyright (c) 1991, 2010, oracle.  all rights reserved.
starting /oracle/product/10.2.0/db_1/bin/tnslsnr: please wait...
tnslsnr for ibm/aix risc system/6000: version 10.2.0.5.0 - production
system parameter file is /oracle/product/10.2.0/db_1/network/admin/listener.ora
log messages written to /oracle/product/10.2.0/db_1/network/log/listener.log
listening on: (description=(address=(protocol=tcp)(host=test)(port=1521)))
listening on: (description=(address=(protocol=ipc)(key=extproc0)))
connecting to (description=(address=(protocol=tcp)(host=test)(port=1521)))
status of the listener
------------------------
alias                    listener
version                  tnslsnr for ibm/aix risc system/6000: version 10.2.0.5.0 - production
start date                05-nov-2012 08:58:49
uptime                    0 days 0 hr. 0 min. 0 sec
trace level              off
security                  on: local os authentication
snmp                      on
listener parameter file  /oracle/product/10.2.0/db_1/network/admin/listener.ora
listener log file        /oracle/product/10.2.0/db_1/network/log/listener.log
listening endpoints summary...
  (description=(address=(protocol=tcp)(host=test)(port=1521)))
  (description=(address=(protocol=ipc)(key=extproc0)))
services summary...
service plsextproc has 1 instance(s).
  instance plsextproc, status unknown, has 1 handler(s) for this service...
the command completed successfully
总结:/etc/hosts文件设置很重要,这里设置不正确,很多地方都要出错,特别是rac,会报很多奇怪的错误,配置的时候要多注意。
其它类似信息

推荐信息