LSNRCTL> status
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=abc.domain.com)(PORT=1521)))
TNS-12541: TNS:no listener
TNS-12560: TNS:protocol adapter error
TNS-00511: No listener
Linux Error: 111: Connection refused
I have registered 1518 using following command
Alter system register
can connect with sql developer using 1518 as port but cannot connect using port 1521
listener.ora file is
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = orcl)
(ORACLE_HOME = /u01/app/oracle/product/11.2.0/db_1)
(SID_NAME = ORCL)
)
)
tnsnames.ora file is
ORCL =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = abc.domain.com)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = orcl)
)
)
Related
I have a VM in Oracle VM Virtual Box running Windows XP. In this VM, I have install Visual Studio .net 2003 with nhibertante ORM to connect to BBDD Oracle 12.2.
Oracle database is hosts in my physical machine with Windows 11 SO. The network configuration between VM and host that ok, or I suppose it, because the ping network servicio work ok.
In my VM I run a SQL*Plus command interface and I try to connect to Oracle database in the host machine.
I use the follow command: sqlplus user/pass#service
Well, the error I receive is:
ORA-12541: TNS: no listener
Maybe some configuration in listener.ora or tnsname.ora not be ok, but I tried modify several parameter but it didn't work.
My tnsname.ora in VM is:
`LISTENER =
(ADDRESS =
(PROTOCOL = TCP)
(HOST = 192.168.56.7)
(PORT = 1521)
)
orcl =
(DESCRIPTION =
ADDRESS =
our text`(PROTOCOL = TCP)
(HOST = 192.168.56.7)
(PORT = 1521)
)
(CONNECT_DATA =
(SERVER = dedicated)
(SERVICE_NAME = orcl)
)
)
`
My listener.ora in my host machine is:
`SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = orcl)
(ORACLE_HOME = C:\app\orclDiego\product\12.2.0\dbhome_1)
(PROGRAM = extproc)
(ENVS = "EXTPROC_DLLS=ONLY:C:\app\orclDiego\product\12.2.0\dbhome_1\bin\oraclr12.dll")
)
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.56.7)(PORT = 1521))
)
)
`
I am trying to configure Oracle database 18C on Azure cloud VM.
I have installed the Oracle database and now I am trying to configure Listener
I have set up a public static IPv4 address for the VM
When I am trying to add the IP address in the listener and tnsnames file, I am getting this error
Error listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=IP)(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: 49: Unknown error
Here is my listener.ora and tsnnames.ora file configuration.
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = CLRExtProc)
(PROGRAM = extproc)
(ENVS = "EXTPROC_DLLS=ONLY:E:\app\Oracle\product\11.2.0\dbhome_1\bin\oraclr11.dll")
)
(SID_DESC =
(SID_NAME = ORCL)
)
)
LISTENER =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = IPaddress)(PORT = 1521))
)
ADR_BASE_LISTENER = C:\Oracle\Oracle18C\log
ORCL =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = IPaddress)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = orcl)
)
)
Ping is working for the IP address when I try with my local machine
When I tried using the hostname 'oraclevm' then listener was able to start up
the following a working example for listener.ora
[oracle#ol7-19 ~]$ cd $ORACLE_HOME/network/admin
[oracle#ol7-19 admin]$ more listener.ora
# listener.ora Network Configuration File: /home/oracle/Downloads/19c/network/admin/listener.ora
# Generated by Oracle configuration tools.
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = ol7-19.localdomain)(PORT = 1521))
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
)
I just installed the Oracle 18c XE Dadtabase and created a PDB (XEPDB1) inside the CDB. I then created a new schema inside the PDF and I can connect to that schema successfully using the Service Name (SQL Developer).
But my legacy application requires a SID connection, which seems to be allowed using the USE_SID_AS_SERVICE_XE = on line in listener.ora. I also added the SID_DESC to the SID_LIST, but I still get the error:
TNS:listener does not currently know of SID given in connect descriptor
This is my listener.ora:
DEFAULT_SERVICE_LISTENER = XE
USE_SID_AS_SERVICE_XE = on
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = CLRExtProc)
(ORACLE_HOME = C:\app\michael\product\18.0.0\dbhomeXE)
(PROGRAM = extproc)
(ENVS = "EXTPROC_DLLS=ONLY:C:\app\michael\product\18.0.0\dbhomeXE\bin\oraclr18.dll")
)
(SID_DESC =
(GLOBAL_DBNAME = XE
(ORACLE_HOME = C:\app\michael\product\18.0.0\dbhomeXE)
(SID_NAME = XEPDB1
)
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = persik.ddns.vmware.com)(PORT = 1521))
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
)
)
And this is the tnsnames.ora:
XE =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = XE)
)
)
XEPDB1 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = XEPDB1)
)
)
LISTENER_XE =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
ORACLR_CONNECTION_DATA =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
)
(CONNECT_DATA =
(SID = CLRExtProc)
(PRESENTATION = RO)
)
)
It is supposed to be USE_SID_AS_SERVICE_LISTENER_NAME refer section 7.4.19 in your case listener name is LISTENER
i.e USE_SID_AS_SERVICE_LISTENER
Test case with Java code and 18xe docker container.
Commented out line in listener.ora and running java code
[oracle#240946cde855 admin]$ cat listener.ora | grep on
# listener.ora Network Configuration File:
#USE_SID_AS_SERVICE_LISTENER=on
$grep "1521" Conn.java
Connection conn = DriverManager.getConnection("jdbc:oracle:thin:#192.168.99.128:1521:xepdb1", "hr", "hr");
$ java -cp "ojdbc8.jar" Conn
Exception in thread "main" 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
Uncommenting and bouncing listener
[oracle#240946cde855 admin]$ sed -i 's|#USE|USE|g' listener.ora
[oracle#240946cde855 admin]$ cat listener.ora | grep on
# listener.ora Network Configuration File:
USE_SID_AS_SERVICE_LISTENER=on
[oracle#240946cde855 admin]$ lsnrctl reload
LSNRCTL for Linux: Version 18.0.0.0.0 - Production on 22-JUL-2020 10:39:52
Copyright (c) 1991, 2018, Oracle. All rights reserved.
Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
The command completed successfully
$ java -cp "ojdbc8.jar" Conn
Oracle Database 18c Express Edition Release 18.0.0.0.0 - Production
I had my database working for over a year since yesterday. Out of sudden, I am no longer able to connect.
Error I am getting is:
Status : Failure -Test failed: Listener refused the connection with the following error:
ORA-12505, TNS:listener does not currently know of SID given in connect descriptor
Oracle 11.2
Windows 7
Both db and the listener are up and running. Port 1521 is opened.
C:\Apps\Oracle\product\11.2.0\dbhome_1\BIN>netstat -a -n -o| findstr "1521"
TCP 127.0.0.1:1521 0.0.0.0:0 LISTENING 2412
trying to log in via sqlplus
C:\depot\SBApp\main>sqlplus sbdba0/sbdba0#SBDB
SQL*Plus: Release 11.2.0.2.0 Production on Thu Dec 3 10:04:29 2015
Copyright (c) 1982, 2010, Oracle. All rights reserved.
Error:
ORA-12514: TNS:listener does not currently know of service requested in connect descriptor
Listener.ora
# listener.ora Network Configuration File: C:\Apps\Oracle\product\11.2.0\dbhome_1\NETWORK\ADMIN\listener.ora
# Generated by Oracle configuration tools.
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = CLRExtProc)
(ORACLE_HOME = C:\Apps\Oracle\product\11.2.0\dbhome_1)
(PROGRAM = extproc)
(ENVS = "EXTPROC_DLLS=ONLY:C:\Apps\Oracle\product\11.2.0\dbhome_1\bin\oraclr11.dll")
)
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
)
)
ADR_BASE_LISTENER = C:\Apps\Oracle\product
tnsnames.ora
ORACLR_CONNECTION_DATA =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
)
(CONNECT_DATA =
(SID = CLRExtProc)
(PRESENTATION = RO)
)
)
###################################################################################################
#SBDB
SBDB =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = SBDB)
)
)
ifile=C:\Apps\Oracle\product\11.2.0\dbhome_1\NETWORK\ADMIN\tnsnames_QA.ora
ifile=C:\Apps\Oracle\product\11.2.0\dbhome_1\NETWORK\ADMIN\tnsnames_PROD.ora
I am out of ideas, any help will be appreciated.
solved,
had to replace localhost from *.ora files with my PC hostname.
I have Oracle Database 11g Express Edition Release 11.2.0.2.0 - 64bit Production installed on virtual machine(VirtualBox, OS: Oracle Linux 7).
All going normal, when I try to connect from the virtual machine where oracle database installed. (sqlplus sys/sys_password#192.168.56.101/XE as sysdba).
But I have ORA-12170 error when I try to connect to oracle from the host OS (Windown 7 x64) by using the same command.
ping 192.168.56.101 command from host OS is successfull.
Now I'm using host only network, but I had same results with bridged connection.
Here is my tnslistener.ora file:
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = XE)
(ORACLE_HOME = /u01/app/oracle/product/11.2.0/xe)
)
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = /u01/app/oracle/product/11.2.0/xe)
(PROGRAM = extproc)
)
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC_FOR_XE))
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost.localdomain)(PORT = 1521))
)
)
DEFAULT_SERVICE_LISTENER = (XE)
What am I doing wrong?
It seems your listener is incorrectly configured. If you use localhost.localdomain as HOST then the listener will bind to loopback interface only.
Try to use actual IP address instead of localhost.localdomain. Also you can use 0.0.0.0 as HOST so the listener will bind to any interface to avoid hardcoded IP address, but I don't recommend this on production server.
Also check if your guest firewall does allow TCP communication on 1521 port.
Following is my working listener.ora:
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = /u01/app/oracle/product/11.2.0/xe)
(PROGRAM = extproc)
)
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC_FOR_XE))
(ADDRESS = (PROTOCOL = TCP)(HOST = 0.0.0.0)(PORT = 1521))
)
)
DEFAULT_SERVICE_LISTENER = (XE)