Oracle TNS: No Listener error while tnsping for my service - oracle

I just Installed Oracle 11g on windows 7 64bit, and when I tried to ping using tnsping I faced this error TNS-12541: TNS:no listener.
So, I tried to start the listener using LSNRCTL> start also I faced this error:
TNS-12560: TNS:protocol adapter error
TNS-00530: Protocol adapter error

Set ORACLE_HOME and try starting the Listener again.

Related

Why am I getting "cx_Oracle.DatabaseError: ORA-12541: TNS:no listener" error when I try to connect to oracle database from vscode?

I have a script I wrote to connect to my local oracle database. It worked perfectly before now. I was able to connect and populate the database with data from vscode. After I formatted my machine and reinstalled oracle database and instance client. I couldn't connect again, whenever I try, I get this error
Traceback (most recent call last):
File "c:\Users\ChiNedu\Documents\python\Oracle\oracle.py", line 10, in <module>
cnx = cx_Oracle.connect(conStr)
cx_Oracle.DatabaseError: ORA-12541: TNS:no listener
PS C:\Users\ChiNedu\Documents\python\Oracle>
when I type lsnrctl stat in command prompt, I get this
LSNRCTL for 64-bit Windows: Version 19.0.0.0.0 - Production on 09-FEB-2023 17:33:46
Copyright (c) 1991, 2019, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=DESKTOP-QPAJR53)(PORT=1521)))
TNS-12545: Connect failed because target host or object does not exist
TNS-12560: TNS:protocol adapter error
TNS-00515: Connect failed because target host or object does not exist
64-bit Windows Error: 1001: 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
I tried to change the HOST NAME but can't find the %ORACLE_HOME%/network/admin directory from my machine services. Please help me get this fixed. Thanks.

ORA-12541: TNS:no listener when connecting from Grafana

I have Oracle running on my local and I am able to connect fine using sqldevloper however when I try to use it on Grafana i get error "ORA-12541: TNS:no listener"
Here is my Grafana Config
Here is status from lsnrcnt.
lsncntl
Here is the listenr.ora file
Here is the listenr.ora file

ORA-12505, TNS:listener does not currently know of SID given in connect descriptor while connecting as JDBC remote client

I have gone through all the suggestions given by many of you for this query. But unfortunately none of them has fixed my issue.
Problem:- I have installed Oracle12c into a our remote machine(Host1) and by default ORCL database has created and running. After that by using Database configuration Assistant I have created new database "YILIDB". I can connect to these databases from Host1 through sqldeveloper tool. But when I'm trying to access the above databases from another machine (Host2) I can't connect to it. First I tried by using JDBC code to connect to that data base. I got the below Exception.
Code:-
Class.forName("oracle.jdbc.driver.OracleDriver");
Connection conn = DriverManager.getConnection("jdbc:oracle:thin:172.26.8.188:1521:YILIDB", "WM6",
"WM6");
Error:-
java.sql.SQLException: Listener refused the connection with the following error:
ORA-12505, TNS:listener does not currently know of SID given in connect descriptor
at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:825)
at oracle.jdbc.driver.PhysicalConnection.connect(PhysicalConnection.java:755)
at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:38)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:599)
at java.sql.DriverManager.getConnection(DriverManager.java:571)
at java.sql.DriverManager.getConnection(DriverManager.java:215)
at ConnectionTest.main(ConnectionTest.java:39)
Caused by: oracle.net.ns.NetException: Listener refused the connection with the following error:
ORA-12505, TNS:listener does not currently know of SID given in connect descriptor
at oracle.net.ns.NSProtocolStream.negotiateConnection(NSProtocolStream.java:324)
at oracle.net.ns.NSProtocol.connect(NSProtocol.java:287)
at oracle.jdbc.driver.T4CConnection.connect(T4CConnection.java:1963)
at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:564)
... 6 more
And when I'm trying to connect from Host2 sqldeveloper to Host1 database I got below error which means basically I can't connect to remote database neither with JDBC code nor using sqldeveloper.
Error while I'm trying to connect from sqldeveloper:-
Status: Test-failed: IO error the network adapter could not establish the connection
And In the remote database machine I have verified services. Both ORCL and YILIDB services are running. I see only one listener in services up and running.
Can someone please provide me the solution for this.
Find the status of >lsnrctl status below
C:\Users\Administrator>lsnrctl status
LSNRCTL for 64-bit Windows: Version 12.1.0.1.0 - Production on 25-OCT-2016 14:14:41
Copyright (c) 1991, 2013, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for 64-bit Windows: Version 12.1.0.1.0 - Production
Start Date 25-OCT-2016 14:04:56
Uptime 0 days 0 hr. 9 min. 44 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Default Service YILIDB
Listener Parameter File C:\app\Administrator\product\12.1.0\dbhome_1\network\admin\listener.ora
Listener Log File C:\app\Administrator\diag\tnslsnr\SMYB2SW12-Yili\listener\alert\log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(PIPENAME=\\.pipe\EXTPROC1521ipc)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=172.28.8.199)(PORT=1521)))
Services Summary...
Service "CLRExtProc" has 1 instance(s).
Instance "CLRExtProc", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully
The problem has been fixed by changing the jdbc url with #.
Previously:
jdbc:oracle:thin:123.45.6.78:1521:YILIDB
Now:
jdbc:oracle:thin:#123.45.6.78:1521:YILIDB

Security Update for Windows preventing Oracle Listener from running?

For the last month I have installed and used Oracle 11 XE, but this morning I restarted my computer and installed new updates from Windows. Now I cannot get the database to work. I know this caused it because I was using SQL Developer right up until I restarted. I get this error when attempting to run in SQL Developer
An error was encountered performing the requested operation:
IO Error: The Network Adapter could not establish the connection
Vendor code 17002
I went to Service and made sure my OracleServiceXE was running, which it was. I tried starting "OracleXETNSListener" and got this message:
The OracleXETNSListener service on Local Computer started and then stopped.
Some services stop automatically if they are not in use by other services and programs.
I then went to CMD and typed "lsnrctl status" and got:
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=<host name>)(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=EXTPROC0)))
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
Now at this point, almost everything I googled told me to start the listener and if that doesn't work run as admin. I did both of those things, but it didn't work.
running normally in cmd:
Starting tnslsnr: please wait...
Unable to OpenSCManager: err=5
TNS-12560: TNS:protocol adapter error
TNS-00530: Protocol adapter error
running as admin:
Starting tnslsnr: please wait...
(note: it stalls for 2 minutes)
TNS-12560: TNS:protocol adapter error
To complicate matters, my computer told me "We couldn't finish installing updates" and that makes me hesitant to uninstall the updates.

connecting to oracle database on Windows

I have two machines on my network:
pc-1 is running on Windows XP SP3, IP 192.168.1.15
pc-2 is running on Windows Vista, IP 192.168.1.16
Now I have loaded Oracle 11gR2 on pc-2 (Vista) and the listener is running with the following settings: address=192.168.1.16 and port=1065.
I am trying to connect to Oracle database via pc-1 (XP) using jdbc thin driver but I get the error The network adapter could not establish the connection.
My JDBC url: jdbc:oracle:thin:#192.168.1.16:1065:ora
The pc-2 is reachable, I checked it by ping 192.168.1.16
I tried a few things from PC-1:
TELNET 192.168.l.16 1065 gives error Connecting To 192.168.1.16...Could not open connection to the host, on port 1065: Connect failed.
The firewall on pc-2 (vista+oracle) is turned off so I don't think firewall is blocking port 1065.
tnsping 192.168.1.16:1065 gives error TNS-12535: TNS:operation timed out
sqlplus sys/sys#//192.168.1.16:1065/ora as sysdba but it gives error
ERROR:ORA-12170: TNS:Connect timeout occurred
Some of the commands output on PC-2
netstat -a
LOCAL ADDRESS------------ FOREIGN ADDRESS-------------- STATE
192.168.1.16:1065----------------- PCNAME -------------------LISTENING
Can anyone please specify in details what shall I do? I am trying to do this first time so no idea about what is going wrong?
You have to give the proper SID details in the tnsnames.ora file located under
for Linux:
/home/oracle/oracle/product/10.2.0/db_1/network/admin/tnsnames.ora
You don't say how you're connecting - I am assuming through TNS?
Did you specify the port of 1065 in your TNSNAMES.ORA file on the XP system?
Can you connect from your XP system using EZCONNECT? That takes tnsnames.ora out of the equation.
sqlplus user/pw#//192.168.1.16:1065/db_name
ERROR:ORA-12170: TNS:Connect timeout occurred
this error usually means failure network connection
It's simple
shut down your windows firewall

Resources