Cannot connect to ExtProc In Oracle 11g - oracle

We have two Oracle instances on one server (both 11g) that are using the same listener. I am having an issue with connecting to the extproc:
TNSNAMES.ORA
EXTPROC_CONNECTION_DATA.NATIONAL.SERVER.COM =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC11G))
)
(CONNECT_DATA =
(SERVICE_NAME = PLSExtProc11g)
)
)
LISTENER.ORA
(DESCRIPTION_LIST=
(DESCRIPTION =
(ADDRESS_LIST=
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC11G))
)
)
)
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc11g)
(ORACLE_HOME = /home/app/oracle/product/11.2.0/dbhome_1)
(ENVS = "EXTPROC_DLLS=ANY")
(PROGRAM = extproc)
)
When I use TNSPING to check the connection, I get the following:
/home/app/oracle/product/11.2.0/dbhome_1/network/admin/sqlnet.ora
$tnsping EXTPROC_CONNECTION_DATA
TNS Ping Utility for Linux: Version 11.2.0.1.0 - Production on 03-NOV-2011 14:03:41
Copyright (c) 1997, 2009, Oracle. All rights reserved.
Used parameter files:
Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC11G))) (CONNECT_DATA = (SERVICE_NAME = PLSExtProc11g)))
TNS-12541: TNS:no listener
I am able successfully tnsping both of the databases but not the EXTPROC_CONNECTION_DATA.

In this particular case there was apparently some type of hidden character in the listener.ora file. Using netca to reconfigure the listener resolved the problem.

change the SID_NAME with the correct value, It may solve the issue.
example:
(SID_NAME = PLSExtProc11g)
to
(SID_NAME = ORCL)

Related

Oracle 18c XE: Connecting to a PDB using SID (for legacy application)

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

cannot connect oracle database from other computer

I have two computers, Computer A has IP (10.11.11.2) which contain oracle database 11g R2 and Computer B has IP (10.11.11.18). I searched alot and make some changes in Tnsnames.ora and listener.ora files but cannot connect. But when I tnsping 10.11.11.2 from client it gives me OK output. That's mean database is accessible from client but I am unable to connect database using Toad or Sqldeveloper.
Error is given :
tns does not currently know of service requested
My Computer A (10.11.11.2) tnsname.ora and listener.ora files paste below:
Tnsnames.ora file
# tnsnames.ora Network Configuration File: D:\app\Mobilityusr\product\11.2.0\dbhome_1\network\admin\tnsnames.ora
# Generated by Oracle configuration tools.
LISTENER_ORCL =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
ORACLR_CONNECTION_DATA =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
)
(CONNECT_DATA =
(SID = CLRExtProc)
(PRESENTATION = RO)
)
)
ORCL =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orcl)
)
)
listener.ora file
# listener.ora Network Configuration File: D:\app\Mobilityusr\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 = D:\app\Mobilityusr\product\11.2.0\dbhome_1)
(PROGRAM = extproc)
(ENVS = "EXTPROC_DLLS=ONLY:D:\app\Mobilityusr\product\11.2.0\dbhome_1\bin\oraclr11.dll")
)
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = 10.11.11.2)(PORT = 1521))
)
)
ADR_BASE_LISTENER = D:\app\Mobilityusr
My Computer B (10.11.11.18) tnsname.ora and listener.ora files paste below:
tnsnames.ora file
# tnsnames.ora Network Configuration File: D:\app\product\11.2.0\dbhome_1\network\admin\tnsnames.ora
# Generated by Oracle configuration tools.
LISTENER_ORCL =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
ORACLR_CONNECTION_DATA =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
)
(CONNECT_DATA =
(SID = CLRExtProc)
(PRESENTATION = RO)
)
)
ORCL =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orcl)
)
)
listener.ora
# listener.ora Network Configuration File: D:\app\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 = D:\app\product\11.2.0\dbhome_1)
(PROGRAM = extproc)
(ENVS = "EXTPROC_DLLS=ONLY:D:\app\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 = D:\app
Image of tnsping from computer B to oracle database (installed on Comupter A) is also attached:
Error image also attached
After a lot of research I solved the problem.And I must share it with you too so that any one who have this problem can solve it easily.
Listener.ora file is used to listen requests. We must add two entries(one for SID and other for machine IP address) in listener.ora if we want to access database from another computer.
Computer A files(listener.ora and tnsnames.ora) setting are given below:
Listener.ora
# listener.ora Network Configuration File: D:\app\Mobilityusr\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 = D:\app\Mobilityusr\product\11.2.0\dbhome_1)
(PROGRAM = extproc)
(ENVS = "EXTPROC_DLLS=ONLY:D:\app\Mobilityusr\product\11.2.0\dbhome_1\bin\oraclr11.dll")
)
(SID_DESC =
(GLOBAL_DBNAME = orcl)
(ORACLE_HOME = D:\app\Mobilityusr\product\11.2.0\dbhome_1)
(SID_NAME = orcl)
)
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
)
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = 10.11.11.2)(PORT = 1521))
)
)
ADR_BASE_LISTENER = D:\app\Mobilityusr
SID_LIST_LISTENER contains two entries first SID_DESC is by default entry and we must add 2nd SID_DESC in order to identify orcl SID otherwise following error will be given by Sqldeveloper or toad or sqlplus when connecting database from other machine:
error: sid does not currently know
Now Listener contain two entries one by default for localhost and we must add 2nd entry which contain server machine IP. By this entry database on server machine can listen coming connections which contain this IP address will be connected to server database.Otherwise database will not be connected.
Note: You can use these configurations but don't forget to change IPs and oracle_home path
and tnsnames.ora file is used to define alias of any database parameters(SID,PORT,HOST). But it is not compulsory to change tnsnames.ora to connect server and client so I am not modifying tnsnames.ora located at server machine.
Computer B tnsnames.ora is same as above mentioned in question.
Computer B listener.ora is same as above mentioned in question.
Summary:
You only need to change listener.ora file located at server machine (Oracle_home/network/admin/).and add two entries one in SID_LIST_LISTENER to add SID detail and 2nd in LISTENER to add machine IP description.
Also check environment variables (ORACLE_UNQNAME,ORACLE_SID,ORACLE_HOME,TNS_ADMIN etc)
One more important thing You must check that Listener service is up and running
use these commands(Open CMD and type) :
**lsnrctl status **
**lsnrctl start **
**lsnrctl stop **
and when you change listener.ora file you must stop and then start lsnrctl service in order to changes effect.
In SQLDeveloper, instead of specifying SID, choose Service Name.
I had lots of trouble with same problem but with Oracle 12C. Finally got it working with almost similar solution.
My database server is on 192.168.1.165 with port 1526.
Also had to open port 1526 in Windows server firewall.
# listener.ora Network Configuration File: G:\app\db12\product\12.1.0\dbhome_1\network\admin\listener.ora
# Generated by Oracle configuration tools.
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = CLRExtProc)
(ORACLE_HOME = G:\app\db12\product\12.1.0\dbhome_1)
(PROGRAM = extproc)
(ENVS = "EXTPROC_DLLS=ONLY:G:\app\db12\product\12.1.0\dbhome_1\bin\oraclr12.dll")
)
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1526))
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1526))
)
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1526))
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.165)(PORT = 1526))
)
)

Listener lsnrctl start TNS-00515: Connect failed because target host or object does not exist 64-bit Windows Error: 1004: Unknown error

I cannot get my listener to start, I have spent hours searching forums and couldn't find any solution.
My goal is to start APEX, but first I have to get listener up&running, when I try, I'm getting:
C:\Users\matulewi>lsnrctl start
LSNRCTL for 64-bit Windows: Version 11.2.0.2.0 - Production on 28-GRU-2015 15:20:45
Copyright (c) 1991, 2014, Oracle. All rights reserved.
Starting tnslsnr: please wait...
TNSLSNR for 64-bit Windows: Version 11.2.0.2.0 - Production
System parameter file is C:\oraclexe\app\oracle\product\11.2.0\server\network\admin\listener.ora
Log messages written to C:\oraclexe\app\oracle\diag\tnslsnr\MATULEWI1\listener\alert\log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(PIPENAME=\.\pipe\EXTPROC1ipc)))
Error listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=MATULEWI1.emea.xxxxx.net)(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: 1004: Unknown error
My tnsnames.ora:
XE =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = MATULEWI1.emea.xxxxx.net)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = XE)
)
)
EXTPROC_CONNECTION_DATA =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
)
(CONNECT_DATA =
(SID = PLSExtProc)
(PRESENTATION = RO)
)
)
ORACLR_CONNECTION_DATA =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
)
(CONNECT_DATA =
(SID = CLRExtProc)
(PRESENTATION = RO)
)
)
listener.ora:
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = C:\oraclexe\app\oracle\product\11.2.0\server)
(PROGRAM = extproc)
)
(SID_DESC =
(SID_NAME = CLRExtProc)
(ORACLE_HOME = C:\oraclexe\app\oracle\product\11.2.0\server)
(PROGRAM = extproc)
)
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
(ADDRESS = (PROTOCOL = TCP)(HOST = MATULEWI1.emea.xxxxx.net)(PORT = 1521))
)
)
DEFAULT_SERVICE_LISTENER = (XE)
Could somebody please help out?
k.
I got this error because I renamed my computer.
Fixed it when I corrected the listener.ora file.
(ADDRESS = (PROTOCOL = TCP)(HOST = YourComputerName)(PORT = 1521))

Oracle TNS listener not starting on CentOS 7

I have installed Oracle 11g Release 2 Express edition on CentOS 7 machine. The installation process is completed successfully saying below.
Starting Oracle Net Listener...Done
Configuring database...Done
Starting Oracle Database 11g Express Edition instance...Done
Installation completed successfully.
When I do tnsping to the service I am getting below error.
Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = i2b2)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = XE)))
TNS-12541: TNS:no listener
I then tried to start the listener and it's failing with below error.
TNSLSNR for Linux: Version 11.2.0.2.0 - Production
NL-00280: error creating log stream /u01/app/oracle/product/11.2.0/xe/network/log/listener.log
NL-00278: cannot open log file
SNL-00016: snlfohd: error opening file
Linux Error: 13: Permission denied
I searched a lot on forums and tried the given solutions there but could not solve the issue. What can be the issue in this case ?
Any help is really appreciated.
Edit:
Here is my tnsnames.ora file.
XE =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = i2b2)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = XE)
)
)
EXTPROC_CONNECTION_DATA =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC_FOR_XE))
)
(CONNECT_DATA =
(SID = PLSExtProc)
(PRESENTATION = RO)
)
)
And listener.ora file.
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 = i2b2)(PORT = 1521))
)
)
DEFAULT_SERVICE_LISTENER = (XE)
Environmental variables:
ORACLE_HOME=/u01/app/oracle/product/11.2.0/xe
export ORACLE_HOME
ORACLE_SID=XE
export ORACLE_SID
export TNS_ADMIN=/u01/app/oracle/product/11.2.0/xe/network/admin
export NLS_LANG=`$ORACLE_HOME/bin/nls_lang.sh`
JAVA_HOME=/usr/java/jdk1.7.0_65
export JAVA_HOME
PATH=$PATH:$HOME/bin:$ORACLE_HOME/bin:/usr/local/apache-ant-1.8.4/bin:$JAVA_HOME/bin
export PATH

oracle 11XE and ODT32 on windows - multiple issues

I installed Oracle 11 XE on a 64bit Windows 2008R2. This is a development machine, therefore I have also installed Oracle Developer Tools for .NET (32bit). Both these installations come with their own version of SQLplus.
I have set up the tnsnames.ora and sqlnet.ora to be identical for both these oracle products, but I cannot connect to the local XE from either SQLplus. I get ORA-12560 everytime. the Oracle 11 XE home page also doesn't start.
---TNSNAmes.ora ----
XE =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = DDSAP236.asxdev.asx.com.au)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = XE)
)
)
EXTPROC_CONNECTION_DATA =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
)
(CONNECT_DATA =
(SID = PLSExtProc)
(PRESENTATION = RO)
)
)
ORACLR_CONNECTION_DATA =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
)
(CONNECT_DATA =
(SID = CLRExtProc)
(PRESENTATION = RO)
)
)
----END TNSNAMEs.ora---
---Listener.Ora ---
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = D:\Oracle\11Express\app\oracle\product\11.2.0\server)
(PROGRAM = extproc)
)
(SID_DESC =
(SID_NAME = CLRExtProc)
(ORACLE_HOME = D:\Oracle\11Express\app\oracle\product\11.2.0\server)
(PROGRAM = extproc)
)
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
(ADDRESS = (PROTOCOL = TCP)(HOST = DMACHINE.MyDomain.com)(PORT = 1521))
)
)
DEFAULT_SERVICE_LISTENER = (XE)
--End listener.ora----
In services.msc and lsntctrl both shows the XElistener service have started.
I am wondering what else I can check?
Can I run XE (32bit) on Win2008R2?
Can I run XE together with ODTODAC32 on Win2008R2?
How do I resolve ORA-12560 so I can connect to the XE database?
Additional Info
In the registry of this machine under HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Note\Oracle I have 5 folders - can someone confirm if this is correct?
The folders are:
KEY_ (not sure if this is correct)
KEY_OracleClient11g_HOME (the Oracle ODT client install's home)
KEY_EX (11g EX install's home)
ODP.Net (part of ODP install )
OracleMTSRecoveryService (part of ODP install)
If that's indeed your TNSNAMES.ORA, your syntax is broken - you have extra spaces in front of the connection aliases (first line of each entry), which might cause your problems. Your TNSNAMES.ORA should look like this:
XE =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = DDSAP236.asxdev.asx.com.au)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = XE)
)
)
If your "real" TNSNAMES.ORA is correct, however:
what is the output of lsnrctl status?
what does your listener log contain?
does sqlplus / as sysdba work?

Resources