ORA-12505: TNS:listener does not currently know of SID given in connect descriptor
When user was connecting to the database though an application, user got the error as below.
Error: ORA-12505: TNS:listener does not currently know of SID given in connect descriptor at OCI call OCIServerAttach. [nQSError: 17014] Could not connect to Oracle database. (HY000)
Cause: User was unable to connect to database through connect descriptor that we use to connect to database from remote server or from application.
Solution: Since listener is running,try to connect the database manually through connect descriptor that is usually stored in tnsnames.ora file. Always make sure that connect descriptor has correct db name, hostname and port name.
SQL*Plus: Release 184.108.40.206.0 Production on Fri Jan 20 04:39:03 2012
Copyright (c) 1982, 2009, Oracle. All rights reserved.
ORA-12505: TNS:listener does not currently know of SID given in connect
Then check your database name in connect descriptor available at tnsnames.ora file.
If that is correct then check your services in listener to find whether requested db is being listened by the listener. You can use below command to check the same.
lsnrctl services listener_name
If db is found, then wait for few seconds and check the connection. If db is not found in the services, then manually register your database to the listener by using below command.
SYS@TEST>alter system register;
Check after few seconds, you will be able to connect to the database using connect descriptor.