Oracle TNS-12505 Error - oracle

I am working with Oracle and what I had to do was to export the existing database to new installation.
I have installed new oracle client 8.1 (Previous was 8.0), I have successfully imported all the instance of database,(Users,Roles, everything).
Basically it is Server and from other individual clients it shares data.
What I am facing a problem now is ,
any XYZ client can not varify its login credentials. I am getting two different types of erros. below I will mention:
TNS-12505: TNS:listener could not resolve SID given in connect descriptor
TNS-12500: TNS:listener failed to start a dedicated server process
TNS-12560: TNS:protocol adapter error
TNS-00530: Protocol adapter error
I have tried almost every option by googling the specified errors.
I have configured the TNSNAMES.ora and LISTENER.ora at server installation and test , they are working well.
But the issue is when I connect through client after configuring TNSNAMES using "Net8 Assitant" it shows the following error.
TNS-12505: TNS:listener could not resolve SID given in connect descriptor
I will try to attach the Configuration files data:
TNSNAMES.ora # Server
# D:\ORANT\NETWORK\ADMIN\TNSNAMES.ORA Configuration File:d:\orant\NETWORK\ADMIN\tnsnames.ora
# Generated by Oracle Net8 Assistant
DATA =
(DESCRIPTION =
(SOURCE_ROUTE = OFF)
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.109)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = data)
(GLOBAL_NAME = data)
(SRVR = DEDICATED)
)
)
LISTENER.ora # Server
# D:\ORANT\NETWORK\ADMIN\LISTENER.ORA Configuration File:d:\orant\NETWORK\ADMIN\listener.ora
# Generated by Oracle Net8 Assistant
LISTENER =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = rwr_mis)(PORT = 1521))
(PROTOCOL_STACK =
(PRESENTATION = TTC)
(SESSION = NS)
)
)
And Finally TNSNAMES.ora # Client
# C:\ORANT\NET80\ADMIN\TNSNAMES.ORA Configuration File:C:\orant\net80\admin\tnsnames.ora
# Generated by Oracle Net8 Assistant
data =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS =
(PROTOCOL = TCP)
(Host = 192.168.0.109)
(Port = 1521)
)
)
(CONNECT_DATA = (SID = ORCL)
)
)
From above settings I am gettin gthe followin gerror at Client side:
TNS-12505: TNS:listener could not resolve SID given in connect descriptor
kindly suggest any solution, I will be very thankful .

update TNSNAMES.ora # client with following code
DATA =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.109)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = data)
)
)

Related

TNS-12545: Connect failed because target host or object does not exist

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))
)

Oracle failing with "Unable to retrieve text of NETWORK/NCR message 65535", seemingly not reading initSID.ora

First time setting up an ODBC link with Oracle. I've set up the listener.ora, tnsnames.ora, and the init file in \hs\admin, but the database link always fails with:
ORA-28545: error diagnosed by Net8 when connecting to an agent
Unable to retrieve text of NETWORK/NCR message 65535
ORA-02063: preceding 2 lines from EXTLINK
28545. 0000 - "error diagnosed by Net8 when connecting to an agent"
*Cause: An attempt to call an external procedure or to issue SQL
to a non-Oracle system on a Heterogeneous Services database link
failed at connection initialization. The error diagnosed
by Net8 NCR software is reported separately.
*Action: Refer to the Net8 NCRO error message. If this isn't clear,
check connection administrative setup in tnsnames.ora
and listener.ora for the service associated with the
Heterogeneous Services database link being used, or with
'extproc_connection_data' for an external procedure call.
Vendor code 28545
No trace file appears, which makes me think that the init file isn't even being read. I can connect to the ODBC database using Access, so I know it works. The ODBC drivers and DG4ODBC are both 64-bit.
Here's what I've tried so far:
I set the HOST in both files to the hostname, to the IP address, and to [HOSTNAME].[DOMAIN].local, but with no change.
I made the connection address (PROTOCOL/HOST/PORT) in tnsnames.ora and listener.ora identical, but with no change.
I replaced the HOST of the listener with random garbage and then TNSPING failed, which it doesn't do otherwise.
I copied the tnsnames.ora.sample, initgd4odbc.ora, and listener.ora.sample files in hs\admin and made a test connection with no ODBC source at the end; but it fails in the same way, with no trace file generated.
I put random characters for the SID_NAME in listener.ora and the SID in CONNECT_DATA in tnsnames.ora and still get the same error, with seemingly no other impact.
Here are the ora files. Some names have been changed to protect confidentiality, but it's otherwise untouched.
tnsnames.ora:
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.[DOMAINNAME].local)
)
)
EXTLINK=
(DESCRIPTION=
(ADDRESS=(PROTOCOL=TCP)(HOST = [HOSTNAME])(PORT=1521))
(CONNECT_DATA=(SID=EXTLINK))
(HS=OK)
)
listener.ora:
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = CLRExtProc)
(ORACLE_HOME = C:\app\[MYUSERNAME]\virtual\product\12.2.0\dbhome_1)
(PROGRAM = extproc)
(ENVS = "EXTPROC_DLLSONLY:C:\app\[MYUSERNAME]\virtual\product\12.2.0\dbhome_1\bin\oraclr12.dll")
)
(SID_DESC=
(SID_NAME=EXTLINK)
(ORACLE_HOME=C:\app\[MYUSERNAME]\virtual\product\12.2.0\dbhome_1)
(PROGRAM=dg4odbc)
)
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = [HOSTNAME])(PORT = 1521))
)
)
CONNECT_TIMEOUT_LISTENER = 0
%ORACLE_HOME\hs\admin\initEXTLINK.ora:
# Windows
HS_FDS_CONNECT_INFO = EXTLINK
HS_FDS_TRACE_LEVEL = 255
HS_FDS_FETCH_ROWS=1
HS_KEEP_REMOTE_COLUMN_SIZE = LOCAL
#HS_NLS_NCHAR=UCS2
HS_LANGUAGE=AMERICAN_AMERICA.WE8ISO8859P1
Connect String:
CREATE PUBLIC DATABASE LINK EXTLINK CONNECT TO "Username" IDENTIFIED BY "Pass" USING 'EXTLINK';
Installed 18c XE instead, and it works perfectly, so that's good enough for me. I have no idea why it was failing in the first place, though.

Unable to connect to a database using sqlplus

I have configurated into my tnsnames.ora my connection string. In my sqlnet.ora my content is as follows:
NAMES.DIRECTORY_PATH= (LDAP, TNSNAMES, HOSTNAME)
NAMES.DEFAULT_DOMAIN = WORLD
TRACE_LEVEL_CLIENT = OFF
SQLNET.EXPIRE_TIME = 30
When I make a tnsping call to a SID from tnsnames.ora I'm gettin the error:
TNS-03505: Failed to resolve name
Sample configuration from tnsname.ora
TNS_NAME =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = HOST.NAME)(PORT = PORT_NUMBER))
)
(CONNECT_DATA =
(SERVICE_NAME = SID)
)
)
What am I doing wrong?
I have used the following connect string without using tnsnames.ora for mappings in order to connect to remote database:
sqlplus username/password#(DESCRIPTION =
(ADDRESS = (PROTOCOL= TCP)(Host= hostname.network)(Port= remote_port))
(CONNECT_DATA = (SID = remote_SID))
)

Creating an oracle database connection with Talend Open Studio

I want to create a database connection with talend open studio. I have installed oracle 10g and sqlplus environnement.
When I have tried creating a connection, I get this error:
java.lang.RuntimeException: 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 org.talend.core.model.metadata.builder.database.JDBCDriverLoader.getConnection(JDBCDriverLoader.java:164)
at org.talend.core.model.metadata.builder.database.ExtractMetaDataUtils.connect(ExtractMetaDataUtils.java:1049)
at org.talend.core.model.metadata.builder.database.ExtractMetaDataFromDataBase.testConnection(ExtractMetaDataFromDataBase.java:311)
at org.talend.repository.ui.utils.ManagerConnection.check(ManagerConnection.java:266)
at org.talend.repository.ui.wizards.metadata.connection.database.DatabaseForm.checkConnection(DatabaseForm.java:2294)
at org.talend.repository.ui.wizards.metadata.connection.database.DatabaseForm.access$45(DatabaseForm.java:2217)
at org.talend.repository.ui.wizards.metadata.connection.database.DatabaseForm$26.widgetSelected(DatabaseForm.java:2549)
at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:234)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4066)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3657)
at org.eclipse.jface.window.Window.runEventLoop(Window.java:825)
....
Here is my login and password:
this is the tnsnames.ora's content
# tnsnames.ora Network Configuration File: D:\oracle\product\10.2.0\db_1\network\admin\tnsnames.ora
# Generated by Oracle configuration tools.
ORCL =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = user)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orcl)
)
)
EXTPROC_CONNECTION_DATA =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
)
(CONNECT_DATA =
(SID = PLSExtProc)
(PRESENTATION = RO)
)
)

Listener refused the connection with the following error: ORA-12505, TNS:listener does not currently know of SID given in connect descriptor

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.

Resources