Monday, February 2, 2009

lsnrctl start fails with TNS-12541, TNS-12560,TNS-00511, Linux Error: 111:

Problem Description
Today while preparing a new production server we faced an interesting problem. After installing oracle database software and database no default listener is created, no sqlnet.ora file. However we manually create the listener.ora and sqlnet.ora as below.

Now if I start the listener it fails with TNS-12541, TNS-12560,TNS-00511, Linux Error: 111:Connection refused.

$lsnrctl start

LSNRCTL for Linux: Version 10.2.0.1.0 - Production on 02-FEB-2009 15:51:20

Copyright (c) 1991, 2005, 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=23.54.56.12)(PORT=1521)))
TNS-12541: TNS:no listener
TNS-12560: TNS: Protocol adapter error
TNS-00511: No listener
Linux Error: 111: Connection refused

I tried many alternatives like changing host to IP address, localhost, hostname. But all fails. In the listener.ora file I set
TRACE_LEVEL_LISTENER = SUPPORT and I found the entry below.

..
..
..

02-FEB-2009 05:07:47:534] nsnainit: NS Connection version: 313
[02-FEB-2009 05:07:47:534] nsnainit: inf->nsinfflg[0]: 0xd inf->nsinfflg[1]: 0xd
[02-FEB-2009 05:07:47:534] nsnainit: "or" info flags: 0xd Translations follow:
native service(s) is (are) wanted
NA disabled remotely for this connection
NA services unavailable on both processes - negotiation not needed

[02-FEB-2009 05:07:47:534] nsnainit: "or" info flags: 0xd Translations follow:
native service(s) is (are) wanted
NA disabled remotely for this connection
NA services unavailable on both processes - negotiation not needed
"and" info flags: 0xd Translations follow:
native service(s) is (are) wanted
NA disabled remotely for this connection
NA services unavailable on both processes - negotiation not needed
..
..
..


Solution of the Problem
I guess the culprit is entry of /etc/hosts file. As if I set parameter host=localhost inside listener.ora it returns message localhost is not found.
Below was my /etc/hosts entry.

$ cat /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 localhost.localdomain THAI_HP

I changed this entry to below.
$ cat /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 THAI_HP localhost.localdomain localhost

And then everything goes ok.

No comments:

Post a Comment