Monday, February 11, 2008

ORA-12541: TNS:no listener

Always check out the original article at http://www.oraclequirks.com for latest comments, fixes and updates.

ORA-12541: TNS:no listener
This error can be seen when trying to connect to a database instance from a client program and the listener service is down or has not been started automatically after a reboot.
Note however that you can also get this error when trying to reach the listener on the wrong TCP port: by default a listener is configured to listen on port 1521 but a DBA could have changed the default port value in case the server runs multiple oracle instances or different database server versions. So, if the listener is configured to listen, let's say, on port 1522 and the TNSNAMES.ora file located in the ORACLE_HOME/network/admin folder contains port 1521 instead, you'll get ORA-12541, even if the listener is up and running.

If you are experiencing this error in a client/server environment and you are not the database administrator, then you should contact the DBA and ask for help. The oracle utility TNSPING should also help you out in the troubleshooting process as it will display all the relevant information.

On Windows platforms the listener is a Windows service that is usually set to start up automatically.
In Oracle XE for Windows, the service name is OracleXETNSListener.
In other versions of Oracle database for Windows, the name is automatically generated upon creating a listener with the Oracle Net Service configuration console, but usually, for a single instance installation, the default name will be OracleOracleHomeNameTNSListener, i.e. OracleOraHome101TNSListener for a database version 10.1 whose oracle home is named OraHome101. You can also check the listener status by executing LSNRCTL from the command line in much the same way as you'd do it on a Unix platform, as explained below.

On a Unix server, if you hold the required privileges, you can check the listener status by executing the listener configuration utility LSNRCTL and issuing the command STATUS:
if the result is like the following:
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=dbserv)(PORT=1521)))
TNS-12541: TNS:no listener
TNS-12560: TNS:protocol adapter error
TNS-00511: No listener
Linux Error: 111: Connection refused

then the listener is not running and you can start it with the command START.

If connecting from SQLDeveloper from a client machine, it's very likely that you get instead the following error message:
An error was encountered performing the requested operation:
Io exception: The Network Adapter could not establish the connection
Vendor code 17002


See message translations for ORA-12541 and search additional resources

1 comment:

Anonymous said...

Problem : oracle-xe in Ubuntu 9.10 - Start and stop of database from the menu is working fine and DB can be accessed through commandline sqlplus. However, not able to go to database homepage through web interface.
Analysis: Identified that TNS listener is not starting. ( I have selected not to start DB at system boot --during initial oracle-xe configure ).
Actions done : Add user into dba group. Gone to $ORACLE_HOME/network/log and given permission to dba for read/write. Started DB again from gui menu and wait for 1 min. Gone to DB homepage (http://127.0.0.1/apex. Its working fine now.

Hope this helps.

--Arun/Bangalore

yes you can!

Two great ways to help us out with a minimal effort. Click on the Google Plus +1 button above or...
We appreciate your support!

latest articles