Skip to Main Content

Breadcrumb

Question and Answer

Connor McDonald

Thanks for the question, Radhakrishna.

Asked: September 22, 2017 - 5:46 pm UTC

Last updated: September 29, 2017 - 1:11 pm UTC

Version: 11G

Viewed 10K+ times! This question is

You Asked

When i am trying to connect to one of our databases on Toad/SQL developer/SQLPLUS, getting the issue that the ORA-12541 TNS No Listener.

steps to take:
verify that the port specified in the connect descriptor is correct in tnsnames.ora
verify that the tns listener is running and that is properly configured.

please check this issue, unable to know what to do.

and Connor said...

The listener is like the doorman at a hotel. The hotel (the database) might be there, and open for business, but if the doorman isn't there, then you can't get in.

From a command prompt do:

tnsping XYZ

for example

C:\oracle\product\grid\bin>tnsping db122

TNS Ping Utility for 64-bit Windows: Version 12.2.0.1.0 - Production on 23-SEP-2017 12:25:38

Copyright (c) 1997, 2016, Oracle.  All rights reserved.

Used parameter files:
C:\oracle\product\12.2.0.1\network\admin\sqlnet.ora


Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = db122)))
OK (20 msec)


This will tell you the host name and port number. You then need to make sure that there is a listener running *on the database host* that matches the above,

C:\oracle\product\grid\bin>lsnrctl status

LSNRCTL for 64-bit Windows: Version 12.2.0.1.0 - Production on 23-SEP-2017 12:26:24

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

Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for 64-bit Windows: Version 12.2.0.1.0 - Production
Start Date                13-SEP-2017 22:38:09
Uptime                    9 days 13 hr. 48 min. 14 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   C:\oracle\product\12.2.0.1\network\admin\listener.ora
Listener Log File         c:\oracle\diag\tnslsnr\xps13\listener\alert\log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=xps13)(PORT=1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=1521)))
Services Summary...
Service "+ASM" has 1 instance(s).
  Instance "+asm", status READY, has 1 handler(s) for this service...
Service "+ASM_DATA" has 1 instance(s).
  Instance "+asm", status READY, has 1 handler(s) for this service...
Service "db122" has 1 instance(s).
  Instance "db122", status READY, has 1 handler(s) for this service...
Service "db122XDB" has 1 instance(s).
  Instance "db122", status READY, has 1 handler(s) for this service...
The command completed successfully


Rating

  (3 ratings)

Is this answer out of date? If it is, please let us know via a Comment

Comments

Radhakrishna juluri, September 26, 2017 - 5:14 pm UTC

It was useful tom, but this didn't help me getting in resolving the issue:

When i checked for
lsnrctl status: getting the error below
TNS-12541: TNS:no listener
TNS-12560: TNS:protocol adapter error
TNS-00511: No listener
32-bit Windows Error: 61: Unknown error

Also when i execute tnsping dbname, getting below error:

TNS-12541: TNS:no listener

Please let me know on how to resolve it.

listner.ora and tnsnames.ora host addresses are in sync

Radhakrishna juluri, September 26, 2017 - 5:16 pm UTC

It was useful tom, but this didn't help me getting in resolving the issue:

When i checked for
lsnrctl status: getting the error below
TNS-12541: TNS:no listener
TNS-12560: TNS:protocol adapter error
TNS-00511: No listener
32-bit Windows Error: 61: Unknown error

Also when i execute tnsping dbname, getting below error:

TNS-12541: TNS:no listener

Please let me know on how to resolve it.

listner.ora and tnsnames.ora host addresses are in sync
Connor McDonald
September 29, 2017 - 1:11 pm UTC

TNS-12541: TNS:no listener

You dont have a listener running.

Check your Windows Services.

A reader, August 01, 2020 - 10:09 am UTC

In my try , first run cmd as admin, then run
tnsping YourOracleSID 
, if it shows error, try the solution here such as run
LSNRCTL.EXE start 
:

https://sort.veritas.com/public/documents/ccser/5.2/windowsandunix/productguides/html/ccer_install/ch03s05.htm

More to Explore

Administration

Need more information on Administration? Check out the Administrators guide for the Oracle Database