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

Cause: “The listener received a request to establish a connection to a database or other service. The connect descriptor received by the listener specified a SID for an instance (usually a database instance) that either has not yet dynamically registered with the listener or has not been statically configured for the listener. This may be a temporary condition such as after the listener has started, but before the database instance has registered with the listener.

There are many possible causes for ORA-12505 but most common scenarios are:

1. Erroneous configuration in Server Side

a. Check the instances are know by the listener

lsnrctl services <listener name>

b. If the service is missing then add the service or correct it if it is incorrectly configured.

c. Stop the listener

# lsnrctl stop

d. Start the listener

#lsnrctl start

e. Check for event in the listener.log file

f. Check Listener by pinging. Tnsnames.ora file contains the “net service name”. This file is used to identify server destinations. This file contains service name and database addresses. Count parameter is optional here, this parameter specify the number of time it should try to connect.

# tnsping <net service name> <count>

2. Erroneous Configuration in Client Side

a. Fix the service name in tnsnames.ora file

b. Check listener by pinging

# tnsping <net service name> <count>