If you are using local naming (TNSNAMES.ORA file):
Make sure that the following is done:
- Make sure that the connect string is defined somewhere in the NAMES.DIRECTORY_PATH defined in $ORACLE_HOME/network/admin/sqlnet.ora file.
Make sure that the tnanames.ora file exists in the $ORACLE_HOME/network/admin directory and it is accessible for the current user. In Unix/Linux there might be restrictions imposed by system administrators on file read privileges.
Make sure that the entry for the connect string is existing in the tnsnames.ora file. Check for spelling errors. (The entry in tnsnames.ora is not case-sensitive. i.e, you may use an entry called mydomain in tnsnames.ora and you can call it using MYDOMAIN).
Check that the entry in tnsnames.ora is correct. You can ensure this by copying the whole connect string details, remove space and enter characters (make the entire definition in one single line) and then you can use this as connect string. (Copy the entire definition of a connect string and paste it in a word processor and remove the characters)
Make sure that the sqlnet.ora is having correct NAMES.DEFAULT value.
Listener is listening for the correct ORACLE_HOME. Check the current ORACLE_HOME and check the tnsnames.ora and sqlnet.ora in the directory of the current ORACLE_HOME. If this is wrong, then change the ORACLE_HOME and try connecting once again.
- Verify that "LDAP" is listed as one of the values of the NAMES.DIRETORY_PATH parameter in the Oracle Net profile (SQLNET.ORA).
Verify that the LDAP directory server is up and that it is accessible.
Verify that the net service name or database name used as the connect identifier is configured in the directory.
Verify that the default context being used is correct by specifying a fully qualified net service name or a full LDAP DN as the connect identifier.
- Verify that "EZCONNECT" is listed as one of the values of the NAMES.DIRETORY_PATH parameter in the Oracle Net profile (SQLNET.ORA).
Make sure the host, port and service name specified are correct.
Try enclosing the connect identifier in quote marks. See the Oracle Net Services Administrators Guide or the Oracle operating system specific guide for more information on naming.
Links:
Configuring TNS file
Ora-Code