ITPub博客

首页 > 数据库 > Oracle > hosts错误造成的 TNS-12542 TNS-12560 TNS-00512

hosts错误造成的 TNS-12542 TNS-12560 TNS-00512

原创 Oracle 作者:qishao7232 时间:2015-08-24 21:57:44 0 删除 编辑
[oracle@ora11g ~]$ lsnrctl start 
LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 24-AUG-2015 21:45:55
Copyright (c) 1991, 2013, Oracle.  All rights reserved.
Starting /u01/app/oracle/product/11.2.0/db_1/bin/tnslsnr: please wait...
TNSLSNR for Linux: Version 11.2.0.4.0 - Production
Log messages written to /u01/app/oracle/diag/tnslsnr/ora11g/listener/alert/log.xml
Error listening on: (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
TNS-12542: TNS:address already in use
 TNS-12560: TNS:protocol adapter error
  TNS-00512: Address already in use
   Linux Error: 98: Address already in use
Listener failed to start. See the error message(s) above...
-------------------------------------------------------------------------------------
说监听已存在,看一看主机配置,网络配置,hostname配置是否正确
-------------------------------------------------------------------------------------
[oracle@ora11g ~]$ cat /etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.2.20    ora11g
[oracle@ora11g ~]$ hostname 
ora11g
[oracle@ora11g ~]$ ifconfig 
eth0      Link encap:Ethernet  HWaddr 08:00:27:70:2C:66  
          inet addr:192.168.2.31  Bcast:192.168.2.255  Mask:255.255.255.0
          inet6 addr: fe80::a00:27ff:fe70:2c66/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:1083 errors:0 dropped:0 overruns:0 frame:0
          TX packets:724 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:93475 (91.2 KiB)  TX bytes:103143 (100.7 KiB)


lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:774 errors:0 dropped:0 overruns:0 frame:0
          TX packets:774 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:53661 (52.4 KiB)  TX bytes:53661 (52.4 KiB)
--------------------------------------------------------------------------------------------
问题很明显,hosts配置有问题,root修改。再启动

--------------------------------------------------------------------------------------------
[oracle@ora11g ~]$ lsnrctl start
LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 24-AUG-2015 21:47:42
Copyright (c) 1991, 2013, Oracle.  All rights reserved.
TNS-01106: Listener using listener name LISTENER has already been started
[oracle@ora11g ~]$ lsnrctl status
LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 24-AUG-2015 21:47:52
Copyright (c) 1991, 2013, Oracle.  All rights reserved.
Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 11.2.0.4.0 - Production
Start Date                24-AUG-2015 21:43:29
Uptime                    0 days 0 hr. 4 min. 26 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Log File         /u01/app/oracle/diag/tnslsnr/ora11g/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=ora11g)(PORT=1521)))
The listener supports no services
The command completed successfully
[oracle@ora11g ~]$ cat /etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.2.31    ora11g
-----------------------------------------------------------------------
问题解决

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/28340999/viewspace-1781531/,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2014-03-12

  • 博文量
    8
  • 访问量
    26185