Lsnrctl Status Results in a TNS-12541 and "No Such File or Directory" Error (Doc ID 760256.1)

Last updated on AUGUST 24, 2017

Applies to:

Oracle Database - Enterprise Edition - Version 11.2.0.3 to 11.2.0.3 [Release 11.2]
Oracle Net Services - Version 9.2.0.1.0 to 11.2.0.3 [Release 9.2 to 11.2]
Oracle Net Services - Version 12.1.0.2 to 12.1.0.2 [Release 12.1]
Information in this document applies to any platform.
This problem can occur on any platform.



Symptoms

Lsnrctl status yields the following error:  TNS-12541: TNS: No listener along with a "no such file or directory" message.

Example:

[oracle@standbydb1 ~]$ lsnrctl status LISTENER

LSNRCTL for Linux: Version 11.1.0.6.0 - Production on 14-OCT-2008 15:25:19

Copyright (c) 1991, 2007, Oracle. All rights reserved.

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))
  TNS-12541: TNS:no listener
  TNS-12560: TNS:protocol adapter error
  TNS-00511: No listener
  Linux Error: 2: No such file or directory
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=XXX.XXX.XXX.XXX)   (PORT=1521)))
  TNS-12541: TNS:no listener
  TNS-12560: TNS:protocol adapter error
  TNS-00511: No listener
  Linux Error: 2: No such file or directory


A check of the process reveals the tnslsnr is running and connections via the listener are successful.

[oracle@standbydb1 ~]$ ps -ef | grep tnslsnr
oracle 2652  1   0  Sep26 ? 00:10:16 /u01/db11g/bin/tnslsnr LISTENER -inherit


Netstat  shows a LISTEN process on the port used by the listener.

[oracle@standbydb1 ~]$ netstat -an | grep 1521

tcp 0 0 192.170.100.245:1521 0.0.0.0:* LISTEN
tcp 0 0 192.170.100.245:1521 192.170.100.11:2555 ESTABLISHED
tcp 0 0 192.170.100.245:1521 192.170.100.11:2554 ESTABLISHED
tcp 0 0 192.170.100.245:1521 192.170.100.11:2553 ESTABLISHED
tcp 0 0 192.170.100.245:1521 192.170.100.245:16902 ESTABLISHED
tcp 0 0 192.170.100.245:1521 192.170.100.11:2558 ESTABLISHED
tcp 0 0 192.170.100.245:1521 192.170.100.90:3263 ESTABLISHED

If you collect an strace/truss on the failing lsnrctl command, you would see the following result when the lsnrctl utility attempted to open a socket file:

$ strace -aef lsnrctl status LISTENER
... 
socket(PF_FILE, SOCK_STREAM, 0) = 5 
access("/var/tmp/.oracle/s#2652.2", F_OK) = -1 ENOENT (No such file or directory) 
access("/var/tmp/o/s#2652.2", F_OK) = -1 ENOENT (No such file or directory) 
... 




Cause

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms