Share |

ORA-12505: TNS:listener could not resolve SID given in connect descriptor

You are trying to connect to a database, but the SID is not known.

Although it is possible that a tnsping command succeeds, there might still a problem with the SID parameter of the connection string.

eg.
C:>tnsping ora920

TNS Ping Utility for 32-bit Windows: Version 9.2.0.7.0 - Production 

Copyright (c) 1997 Oracle Corporation.  All rights reserved.

Used parameter files:
c:\oracle\ora920\network\admin\sqlnet.ora

Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = DEV01)(PORT =
 2491))) (CONNECT_DATA = (SID = UNKNOWN) (SERVER = DEDICATED)))
OK (20 msec)
As one can see, this is the connection information stored in a tnsnames.ora file:
ORA920.EU.DBMOTIVE.COM =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = DEV01)(PORT = 2491))
    )
    (CONNECT_DATA =
      (SID = UNKNOWN)
      (SERVER = DEDICATED)
    )
  )
However, the SID UNKNOWN is not known by the listener at the database server side.
In order to test the known services by a listener, we can issue following command at the database server side:
C:>lsnrctl services

LSNRCTL for 32-bit Windows: Version 10.1.0.2.0 - Production 

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

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=DEV01)(PORT=1521)))
Services Summary...
Service "ORA10G.eu.dbmotive.com" has 1 instance(s).
  Instance "ORA10G", status UNKNOWN, has 1 handler(s) for this service...
    Handler(s):
      "DEDICATED" established:0 refused:0
         LOCAL SERVER
Service "ORA920.eu.dbmotive.com" has 2 instance(s).
  Instance "ORA920", status UNKNOWN, has 1 handler(s) for this service...
    Handler(s):
      "DEDICATED" established:0 refused:0
         LOCAL SERVER
  Instance "ORA920", status READY, has 1 handler(s) for this service...
    Handler(s):
      "DEDICATED" established:2 refused:0 state:ready
         LOCAL SERVER
The command completed successfully
Know services are ORA10G and ORA920.

Changing the SID in our tnsnames.ora to a known service by the listener (ORA920) solved the problem.
 Was this information helpful?  Yes No
If it was not helpful, please take some time to explain why. This is not to ask questions, you can do so in the forum.

Welcome to our forum for Oracle error: ORA-12505 Add your own message



hi
i have worte a java stored procedure for oracle database.
when i executed it i got the following 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 descript
or
The Connection descriptor used by the client was:
192.168.1.2:1521:heads"
heads is the name of database
any one help me.
Can you please post the outcome of following select statement?

select name, value 
from v$parameter
where name in ('db_name', 'db_domain', 'service_names')


 
outcome is
NAME
------------------------
VALUE
------------------------
db_domain


service_names
zeno

db_name
zeno
Your database is called zeno, but you connect to the heads database.

Change your connect string into:
192.168.1.2:1521:zeno 



RCPROD=
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = thdtoltpr01-vip.doubleclick.net)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = thdtoltpr02-vip.doubleclick.net)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = thdtoltpr03-vip.doubleclick.net)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = thdtoltpr04-vip.doubleclick.net)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = thdtoltpr05-vip.doubleclick.net)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = thdtoltpr06-vip.doubleclick.net)(PORT = 1521))
(LOAD_BALANCE = yes)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = PROD_APPS_JDBC)
)
)


I have tried changing SID to PROD_APPS_JDBC but error still remained same
Are you sure PROD_APPS_JDBC is also the correct SID?
It might be that the SERVICE_NAME is different than the SID.

Alternatively, try one of you other server of the load balancer, such as thdtoltpr04-vip.doubleclick.net

 
i have changed the sid as zeno.then i got this
--------------------------------------------------------------------------------
java.sql.SQLException: statement handle not executed
Can you post the piece of code you use to connect to the database?

We suspect there's something wrong with the connection routine.
 
here is the code:

import java.sql.*;
import oracle.jdbc.*;
public class Countries {
public static String getCountry(String id) {
String s=null;
Connection conn=null;
try {
Class.forName("oracle.jdbc.driver.OracleDriver");
String serverN="DEVSERVER";
String portNum="1521";
String sid="zeno";
String url="jdbc:oracle:thin:@"+serverN+":"+portNum+":"+sid;
conn =DriverManager.getConnection(url,"heads","heads");
PreparedStatement pstmt = conn.prepareStatement(
"SELECT NAME FROM KRM_COUNTRY WHERE ID=?");
pstmt.setString(1,id);
ResultSet rSet=pstmt.executeQuery();
pstmt.close();
s=rSet.getString("NAME");
conn.close();
}catch(Exception e) {
s=e.toString();
}
return s;
}
}
 
Listener refused the connection with the following error:
ORA-12505, TNS:listener does not currently know of SID given in connect descriptor
The Connection descriptor used by the client was:
thdtoltpr02-vip.doubleclick.net:1521:PROD


This is the error i get when i try connect using JDBC while my tnsnames.ora has same descprition and i am able to connect using toad.
Can you please post the tnsnames entry?
 
Hi folks,

I am a novice with Oracle and encountered this problem several hrs ago.

Tried a lot of things, looked up several pages on Net, got hints like those on this thread but nothing to solve my problem.

Basically, lsnrctl services did not return the SID I have been using. (BTW, it was working fine before, until I bounced this Wintel host).

Finally, what resolved it was to run lsnrctl services listener. The result shows my intended SID, and subsequently, lsnrctl services also shows it.

Problem solved!


Rgds,
Shahril
Hello all,

I got the same issue today. I had oracle9i and oracle 10g. Later i removed oracle 9i.

I was getting issue in Oracle10G.

when i checked the env. variable in OS--- WV_GATEWAY_CFG , it was set to 'C:\oracle\product\ora92\Apache\modplsql\cfg\wdbsvr.app'. I just deleted this from the variables. After that i connected to my database!!!!!!! :)
 
 
C:>lsnrctl services

LSNRCTL for 32-bit Windows: Version 10.1.0.2.0 - Production

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

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=DEV01)(PORT=1521)))
Services Summary...
Service "PLSExtProc" has 1 instance(s).
Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
Handler(s):
"DEDICATED" established:0 refused:0
LOCAL SERVER
The command completed successfully
Set the local_listener in your database and do a later system register;
 

hi,

i have this problem when connect to database.I also check tnsname.ora in network and tnsname.ora at net80 same.I check listener alaways start but that problem still have.can conduct me to solve that problem.

Can you post the output of foloowing commands:



lsnrctl services
lsnrctl status





Also please tell what SID you are trying to connect to

 

Hi

I am Rajesh

I have confirured listener in the Windows based server (10g). with name of listner_xxxx through NETCA. The listner started successfully, where as when i am trying to connect the database it is telling the above error.

If I am creating the listner with name of listner i can able to connect. But i didnt mention local_listener parameter also in the parameter file.

So please give me the solution.

Can you post the content of your %ORACLE_HOME%/network/admin/listener.ora file

 

Enter your messaghi I need error solution ora 12505 oracle xe

Did you check your tnsnames.ora and compare it to the listener status output?

 

i've created a new sid and when i try to login i get the error :SID given in connect descriptor could not be resolved. I have started the sercice-  C:>lsnrctl services and saw that my SID instance was not created. how do i get the listerner to recognize my new sid. or how can anyone tell me how to create a new sid in the first place.. thanks alot..

Did you also add the new SID to the listener.ora file in your %ORACLE_HOME%/network/admin directory and restarted/reloaded the listener?

Either you need to add it to listener.ora or use dynamic registration by setting the local_listener parameter of the database

no.. can u tell me how to add the new SID to the listener.ora file in  %ORACLE_HOME%/network/admin directory? presently, my lister.ora file has the following content:

# listener.ora Network Configuration File: C:\oracle\product\10.2.0\db_1\network\admin\listener.ora
# Generated by Oracle configuration tools.

SID_LIST_LISTENER =
  (SID_LIST =
    (SID_DESC =
      (SID_NAME = PLSExtProc)
      (ORACLE_HOME = C:\oracle\product\10.2.0\db_1)
      (PROGRAM = extproc)
    )
  )

LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
      (ADDRESS = (PROTOCOL = TCP)(HOST = 172.29.57.188)(PORT = 1521))
    )
  )

 

Can you also post the tnsnames.ora?

I tried to create a new sid test22, host name is Arunima and there's another sid called orclimg present in the tnsnames as u can see. somehow orclimg is working fine but test22 is not.. when i'm doing C:>tnsping orclimg then it is responding properly but when i'm doing C:>tnsping test22 then it says - failed to resolve name.
This is the tnsnames.ora for oracle client.

TEST22_ARUNIMA =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = Arunima)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SID = test22)
      (SERVER = DEDICATED)
    )
  )


ORCLIMG_ARUNIMA =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = Arunima)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SID = orclimg)
      (SERVER = DEDICATED)
    )
  )

You will need to do:

tnsping test22_arunima

How did you create a new SID? Did you use DBCA to create a new database on host Arunima

 

 

yes, i did  tnsping test22_Arunima, this is the output.

C:\Documents and Settings\ADM>tnsping test22_Arunima

TNS Ping Utility for 32-bit Windows: Version 10.2.0.3.0 - Production on 29-JUN-2
010 12:17:36

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

Used parameter files:
C:\oracle\product\10.2.0\client_1\network\admin\sqlnet.ora


Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)
(HOST = Arunima)(PORT = 1521))) (CONNECT_DATA = (SID = test22) (SERVER = DEDICAT
ED)))
OK (20 msec)

-------------------------

I created a new sid by oracle enterprise manager consoleby following steps(i can't paste the screenshot here):

add database to the tree-> add database manually-> host name-Arunima, port id-1521, sid-test22, service name-test22_Arunima(this gets generated by itself when i type host name and sid). when i click on ok it creates a new database. when i want to log on to it using username - system and password- admin, connect as - sysdba, it throws the following error: SID given in connect descriptor could not be resolved.

is there any other way to create a new sid?

 

 

Digite sua mensagem

Nao consigo conecar meu sistema(desenv. em genexus 9 java win), com o banco oracle92.

quando esta gerando o deplymente wizard ocorre a  mensagem :ARILoader: could not parse state file

quando vou instalar (rodar o Siscaf-uwmenu.html) ocorre o seguinte erro

no suitable driver found for jdbc:oracle thin @sfzsrvl03:1521:siateprd

quando rodo no meu ambiente, ele acessa o banco normalmente.

 

 

 

 

Digite sua mensagem

o q faco para resolver estes erros ?

Erros na geracao usando o deploymente wizard e na instalacao do sistema

                     ERROS

Geracao - ARILoader:Coul not parse state file 'aprcinicio'

java.io.filenotfoundexception:stat \state11_3.aprinicio.ari(O SISTEMA NAO PODE ENCONTRAR O ARQUIVO ESPECIFICADO).

INSTALACAO - NO SUITABLE DRIVER FOUND FOR JODBC THIN:@SFZSRLV03:1521:SIATEPRD

 

 

Add your message

 Please provide your personal info 



 Please ask your message as briefly and clear as possible 

 Spam Protection 
Validation Code: n0pk70a6bxekdva3a


Ask Your Question

If you need more information about this particular error message, you can leave a forum message.

We are replying to this message whenever we have some spare time, so please do not consider this as a private 'solve my critical issue asap' service.

Should you need professional Oracle Assistance to make your project a success, please have a look at our consultancy services.


Spam Protection

In order to prevent automatic generation of messages, we are asking for a validation code. This code is unique and is generated every time a new message is asked.

If you do not enter the validation correctly, your message will not be recorded.


Forum Rules

Please be polite, do not USE ALL UPPERCASE, no insults, violance or any other threats.