启动监听出错TNS-12547 TNS-12560 TNS-00517

许久不动的库,今天启动监听时出现问题:
TNS-12547: TNS:lost contact
 TNS-12560: TNS:protocol adapter error
  TNS-00517: Lost contact
   Linux Error: 104: Connection reset by peer


查看了一下文档:
Starting TNS Listener or LSNRCTL Start Yields TNS-12541, Linux Error: 111: Connection Refused (Doc ID 343295.1)


看到自己的/etc/hosts文件内容如下:
[root@ogg2 ~]# cat /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
#127.0.0.1              localhost.localdomain localhost
#::1            localhost6.localdomain6 localhost6
192.168.118.101   ogg2
[root@ogg2 ~]# ifconfig
eth0      Link encap:Ethernet  HWaddr 00:0C:29:DF:5D:6C  
          inet addr:192.168.118.101  Bcast:192.168.118.255  Mask:255.255.255.0
          inet6 addr: fe80::20c:29ff:fedf:5d6c/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:621 errors:0 dropped:0 overruns:0 frame:0
          TX packets:394 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:49377 (48.2 KiB)  TX bytes:43698 (42.6 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:2740 errors:0 dropped:0 overruns:0 frame:0
          TX packets:2740 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:5101148 (4.8 MiB)  TX bytes:5101148 (4.8 MiB)
[root@ogg2 ~]# hostname
ogg2
把    #127.0.0.1              localhost.localdomain localhost 这行的注释去掉
再次启动监听,成功       
请使用浏览器的分享功能分享到微信等