After restoring a database on the Oracle test server, a TNS-12541, tns-12560,tns-00511 error occurred when starting the listening service, as shown in the following scenario:
[Email protected] admin]$ lsnrctl status
Lsnrctl for linux:version 10.2.0.4.0-production on 09-mar-2015 09:13:29
Copyright (c) 1991, Oracle. All rights reserved.
Connecting to (Description= (address= (PROTOCOL=IPC) (Key=extproc1)))
Tns-12541:tns:no Listener
Tns-12560:tns:protocol Adapter Error
Tns-00511:no Listener
Linux Error:111:connection refused
Connecting to (Description= (address= (protocol=tcp) (host=getlnx01.esqule.com) (port=1521)))
Tns-12541:tns:no Listener
Tns-12560:tns:protocol Adapter Error
Tns-00511:no Listener
Linux Error:111:connection refused
[[email protected] dbs]$ lsnrctl start
Lsnrctl for linux:version 10.2.0.4.0-production on 09-mar-2015 09:20:46
Copyright (c) 1991, Oracle. All rights reserved.
Starting/u01/app/oracle/product/10.2.0/db_1/bin/tnslsnr:please wait ...
Tnslsnr for Linux:version 10.2.0.4.0-production
System parameter File Is/u01/app/oracle/product/10.2.0/db_1/network/admin/listener.ora
Log messages Written To/u01/app/oracle/product/10.2.0/db_1/network/log/listener.log
Listening on: (Description= (Address= (PROTOCOL=IPC) (Key=extproc1)))
Listening on: (Description= (Address= (protocol=tcp) (host=getlnx01.esqule.com) (port=1521)))
Connecting to (Description= (address= (PROTOCOL=IPC) (Key=extproc1)))
Tns-12547:tns:lost Contact
Tns-12560:tns:protocol Adapter Error
Tns-00517:lost Contact
Linux error:104:connection Reset by peer
Connecting to (Description= (address= (protocol=tcp) (host=getlnx01.esqule.com) (port=1521)))
Tns-12541:tns:no Listener
Tns-12560:tns:protocol Adapter Error
Tns-00511:no Listener
Linux Error:111:connection refused
Because once encountered and resolved TNS-12541 such errors, immediately check the/etc/hosts file, the results found that the IP address is wrong, the correct IP address should be 192.168.7.221, not careless hand mistakenly write wrong 192.168.7.211
[[Email protected] ~] # more/etc/hosts
# don't remove the following line, or various programs
# that require network functionality would fail.
127.0.0.1 getlnx01.esqule.com getlnx01
This error still occurs after modifying to the correct IP address, followed by official documentation starting TNS Listener or lsnrctl Start yields TNS-12541, Linux error:111:connection refuse D (document ID 343295.1), only to find that because the local host loopback name and address is not correct, after modifying the/etc/hosts, restart the monitoring service, the problem is resolved.
[Email protected] ~]$ more/etc/hosts
# don't remove the following line, or various programs
# that require network functionality would fail.
127.0.0.1 localhost.localdomain localhost
Cause
1. There is possibly a incorrect IP Address specified for the host in the/etc/hosts file.
For example:
192.168.101.101 prod1.us.oracle.com Prod1
Whereas the actual IP address for the host ' prod1.us.oracle.com ' is 192.168.101.110
2. Also, the localhost reference may be incorrect or missing from the/etc/hosts file.
3. Oracle May is not having read access to/etc/nsswitch.conf file.
Solution
To implement the solution, please execute the following steps:
1. Correct the mapping in the/etc/hosts file by adding/correcting the IP address and/or hostname reference for the UNIX/L Inux Server (both long and short host names).
For example:
# Add or edit the/etc/hosts file to include a valid entry for the Server:
192.168.101.110 prod1.us.oracle.com Prod1
2. Check that the localhost loopback name and address is correct (both long and short host names).
An example of a correct localhost entry would be as follows:
127.0.0.1 localhost.localdomain localhost
3. Remember to save the/etc/hosts file and then start the listener.
4. Check permissions on/etc/nsswitch.conf file to ensure group and other has read access.
-If Necessary Change permisions on/etc/nsswitch.conf as follows:
chmod 644/etc/nsswitch.conf
Oracle Monitoring service startup failure case