Monday, May 18, 2015

ORA-12505, TNS:listener does not currently know of SID given in connect descriptor

ORA-12505, TNS:listener does not currently know of SID given in connect descriptor



I'm having a problem with an Oracle database. Yesterday everything was working fine, I had an application that was using the database and there was no problem. At the end of the day I installed MySQL on the same server (I don't think it can be related but anyway..) and had to restart the server. Today when I was using my application to access the Oracle database I had a connection error:
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
Then I went to the server. All the services are up and the database is down.
When I try to login normally, I get an error saying that Oracle is not available, and can only connect as sysdba. Then when I try to start the database up I get the following errors:
SQL Plus console display
Any help is apreciated. Thanks in advance!
shareimprove this question

migrated from stackoverflow.com May 13 '14 at 13:43

This question came from our site for professional and enthusiast programmers.

2 Answers

Did you set the ORACLE_SID? I think the problem is there
shareimprove this answer

    
This should be a comment. Unless you are sure it is the correct answer to the problem. –  ypercube May 13 '14 at 17:59
    
Yes, I had the ORACLE_SID and ORACLE_HOME set. –  Pedro Mendes May 14 '14 at 8:27
    
Ok sorry, I'm new here and don't know the exact rules to post! –  eliatou May 14 '14 at 9:07
up vote 0 down vote accepted
Well, my teammate found the answer to the problem.
He changed some details in the file 'tnsnames.ora' at ORACLE_HOME\NETWORK\ADMIN. He just replaced “hostname” by “localhost”.
WP5 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = <b>localhost</b>)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = WP5)
)
)
LISTENER_WP5 =<br> (ADDRESS = (PROTOCOL = TCP)(HOST = <b>localhost</b>)(PORT = 1521))
A new startup (without leaving sqlplus) made it work!
Oracle success console message
PS: We still have no ideia why/how it was working before, since the file updated date dates from about 2 weeks ago.

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.