Ora 12541 tns no listener linux

How to Resolve ORA-12541: TNS:no listener

ORA-12541 is the same as TNS-12541, they all indicate that the listener is not running according to your specified destination.

Let’s see how we reproduce ORA-12541 and TNS-12541.

SQL*Plus throws ORA-12541

TNSPING throws TNS-12541

TNS Ping Utility for 64-bit Windows: Version 12.1.0.1.0 — Production on 22-JUL-2014 19:20:06

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

Used parameter files:
C:\oracle\app\client\ed\product\12.1.0\client_1\network\admin\sqlnet.ora

Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = primary01)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = compdb)))
TNS-12541: TNS:no listener

Cause

The connection cannot find the listener, it could be:

    The listener is not started.

This is the most common problem of ORA-12541 we have met. Just start it up and make sure it’s running.

Backup port like 1522 may be used by the listener for connection, you should ask for DBA to handle it.

Please check every parameter in your connect descriptor and make sure they are correct.

It’s rare, but it did happen in a very complex network environment. Part of connections are routed by some network device to an unknown server where no listener on port 1521.

Solution

Check the status and port of LISTENER on server side and start it if necessary.

[oracle@primary01 ~]$ lsnrctl status

LSNRCTL for Linux: Version 12.1.0.1.0 — Production on 22-JUL-2014 19:22:34

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

As you can see, the database port is 1521 without questions. But the listener is not started. So let’s start it up.

[oracle@primary01 ~]$ lsnrctl start

Читайте также:  Iso master linux установка

LSNRCTL for Linux: Version 12.1.0.1.0 — Production on 22-JUL-2014 19:23:59

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

Starting /u01/app/oracle/product/12.1.0/dbhome_1/bin/tnslsnr: please wait.

TNSLSNR for Linux: Version 12.1.0.1.0 — Production
System parameter file is /u01/app/oracle/product/12.1.0/dbhome_1/network/admin/listener.ora
Log messages written to /u01/app/oracle/diag/tnslsnr/primary01/listener/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=primary01)(PORT=1521)))

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))
STATUS of the LISTENER
————————
Alias LISTENER
Version TNSLSNR for Linux: Version 12.1.0.1.0 — Production
Start Date 22-JUL-2014 19:23:59
Uptime 0 days 0 hr. 0 min. 2 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /u01/app/oracle/product/12.1.0/dbhome_1/network/admin/listener.ora
Listener Log File /u01/app/oracle/diag/tnslsnr/primary01/listener/alert/log.xml
Listening Endpoints Summary.
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=primary01)(PORT=1521)))
The listener supports no services
The command completed successfully

10 thoughts on “How to Resolve ORA-12541: TNS:no listener”

Hello Ed, Used three of your posts related to listener and TNS setup, they did the trick, all of my issues are resolved. I’ve worked with Oracle since the 1980s and this has always been a hit and miss subject for me, but you have provided an excellent web tech information resource. Well done!!

Hi Ed, I have the same issue,I did start the listener but still it doesn’t work. LSNRCTL for Linux: Version 12.2.0.1.0 – Production on 14-MAY-2020 10:21:14 Copyright (c) 1991, 2016, Oracle. All rights reserved. Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.1.102)(PORT=1539)))
STATUS of the LISTENER
————————
Alias LISTENER
Version TNSLSNR for Linux: Version 12.2.0.1.0 – Production
Start Date 14-MAY-2020 10:12:47
Uptime 0 days 0 hr. 8 min. 27 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /ora01/app/oracle/product/12.2.0/db_1/network/admin/listener.ora
Listener Log File /ora01/app/oracle/diag/tnslsnr/server/listener/alert/log.xml
Listening Endpoints Summary…
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.1.102)(PORT=1539)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcps)(HOST=server)(PORT=5500))(Security=(my_wallet_directory=/ora01/app/oracle/admin/orcl/xdb_wallet))(Presentation=HTTP)(Session=RAW))
Services Summary…
Service “ORA12CXDB” has 1 instance(s).
Instance “ORA12C”, status READY, has 1 handler(s) for this service…
Service “a50ca342f86bccc0e0536801a8c085de” has 1 instance(s).
Instance “ORA12C”, status READY, has 1 handler(s) for this service…
Service “orcl” has 1 instance(s).
Instance “ORA12C”, status READY, has 1 handler(s) for this service…
Service “orclpdb” has 1 instance(s).
Instance “ORA12C”, status READY, has 1 handler(s) for this service…
The command completed successfully and if I run the below command I get the same error:- ./sqlplus anju/anju@192.168.1.102/ORA12C SQL*Plus: Release 12.2.0.1.0 Production on Thu May 14 10:34:59 2020 Copyright (c) 1982, 2016, Oracle. All rights reserved. ERROR:
ORA-12541: TNS:no listener this is my listener.ora file:- LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.102)(PORT = 1539))
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
)
) Could you please help.

Читайте также:  Лабораторная работа файловая система ос linux

Since your listener port is not the default one (1521), you should provide the port number in the connection string. sqlplus anju/anju@192.168.1.102 :1539 /ORA12C

Thank you Ed ,but it gave me this error:- [oracle@server bin]$ ./sqlplus anju/anju@192.168.1.102:1539/ORA12C SQL*Plus: Release 12.2.0.1.0 Production on Thu May 14 11:47:18 2020 Copyright (c) 1982, 2016, Oracle. All rights reserved. ERROR:
ORA-12514: TNS:listener does not currently know of service requested in connect
descriptor

Please check the service name (NOT instance name) that you used in the connection string. Normally, the service and the instance name are the same, but in your case, it’s not. You may check the following post for more information: How to Resolve ORA-12514: TNS:listener does not currently know of service requested in connect descriptor.

LSNRCTL> status
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=1521)))
TNS-12541: TNS:no listener
TNS-12560: TNS:protocol adapter error
TNS-00511: No listener
64-bit Windows Error: 61: Unknown error
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))
TNS-12541: TNS:no listener
TNS-12560: TNS:protocol adapter error
TNS-00511: No listener
64-bit Windows Error: 2: No such file or directory
LSNRCTL> start LISTENER
Starting tnslsnr: please wait… Unable to OpenSCManager: err=5
TNS-12560: TNS:protocol adapter error
TNS-00530: Protocol adapter error

Источник

Using oracle db through ssh tunnel. Error «ORA-12541: TNS:no listener»

Hello I’ve got a problem accessing Oracle DB from our datacenter through a tunnel. We’ve got a pretty standard datacenter with one machine being accessible from the outside (I put it’s IP in the /etc/hosts file as dc) and the Oracle DB inside. The IP address of our oracle database on internal network is 192.168.1.7 To create a tunnel I’m using the command:

 ssh -L 1521:192.168.1.7:1521 root@dc 

and of course it works (sometimes I also add some debug -vv to see if anything is passing through). Now the difficult part — connecting to Oracle. I installed instantclient 11.2. and my tnsnames.ora looks like that:

testdb = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521)) ) (CONNECT_DATA = (SERVICE_NAME = dbname) ) ) 
./sqlplus username/pass@testdb 
./sqlplus username/pass@testdb SQL*Plus: Release 11.2.0.1.0 Production on Wed Jan 13 20:46:07 2010 Copyright (c) 1982, 2009, Oracle. All rights reserved. ERROR: ORA-12541: TNS:no listener Enter user-name: 

When I’m trying to execute this same command on when I’m on the intranet it works (obviously the only difference is that in the tnsnames.ora HOST we have 192.168.1.7 and not the localhost). I also tried to use the simple command line:

./sqlplus username/pass@//localhost:1521/testdb 
./sqlplus username/pass@//localhost:1521/testdb 

But nothing helped 🙂 I would appreciate any help or suggestions. Am I missing some ssh flag to make it possible? Probably the log file:

*********************************************************************** Fatal NI connect error 12541, connecting to: (DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=DBNAME)(CID=(PROGRAM=sqlplus@velvet)(HOST=velvet)(USER=johndoe)))) VERSION INFORMATION: TNS for Linux: Version 11.2.0.1.0 - Production TCP/IP NT Protocol Adapter for Linux: Version 11.2.0.1.0 - Production Time: 13-JAN-2010 20:48:42 Tracing not turned on. Tns error struct: ns main err code: 12541 TNS-12541: Message 12541 not found; No message file for product=network, facility=TNS ns secondary err code: 12560 nt main err code: 511 TNS-00511: Message 511 not found; No message file for product=network, facility=TNS nt secondary err code: 111 nt OS err code: 0 

where velvet is my local hostname and johndoe is my local username. Why is it sent to the other side? UPDATE: After investigating a little bit more from inside datacenter and it looks like: — the first connection is going to the port 1521 — but then sqlplus is redirected to the port number > 3300, which is different everytime and incrementing by 3 (at least few tries I had) — when we are trying to connect trough a tunnel sqlplus will try to connect to localhost and it will obviously fail So the error «No Listener» comes probably from the fact that we are not redirecting those ports. Is there any way (probably some option in tnsnames.ora file) to force some specific port to be used?

Читайте также:  Linux разрешить пользователю доступ папке

Источник

Оцените статью
Adblock
detector