Home / Oracle Error / ORA-12154: TNS could not resolve the connect identifier specified

ORA-12154: TNS could not resolve the connect identifier specified

ORA-12154 is oracle common error.

Cause: A connection to a database or other service was requested using a connect identifier, and the connect identifier specified could not be resolved into a connect descriptor using one of the naming methods configured.

For example, if the type of connect identifier used was a net service name then the net service name could not be found in a naming method repository, or the repository could not be located or reached.

 

Action:  The following actions may be appropriate:

If you are using local naming (tnsnames.ora file):

  • Make sure that TNSNAMES is listed as one of the values of the names. directory_path parameter in the sqlnet.ora Oracle Net profile.
  • Verify that a tnsnames.ora file exists and is in the proper directory and is accessible.
  • Check that the net service name used as the connect identifier exists in the  tnsnames.ora file.
  • Make sure there are no syntax errors anywhere in the  tnsnames.ora file. Look for unmatched parentheses

Update .bash_profile File.

If you are using the standard Oracle client, the Database attribute value must specify a valid service name defined in tnsnames.ora which is located in $ORACLE_HOME/network/admin/tnsnames.ora For example, for the following tnsnames.ora entry, the Database attribute value needs to be orcldb:
If we do not use tnsnames.ora , we can use SQL connection string , connection string format below:
 

 

ORA-12154 is oracle common error.

Cause: A connection to a database or other service was requested using a connect identifier, and the connect identifier specified could not be resolved into a connect descriptor using one of the naming methods configured.

For example, if the type of connect identifier used was a net service name then the net service name could not be found in a naming method repository, or the repository could not be located or reached.

 

Action:  The following actions may be appropriate:

If you are using local naming (tnsnames.ora file):

  • Make sure that TNSNAMES is listed as one of the values of the names. directory_path parameter in the sqlnet.ora Oracle Net profile.
  • Verify that a tnsnames.ora file exists and is in the proper directory and is accessible.
  • Check that the net service name used as the connect identifier exists in the  tnsnames.ora file.
  • Make sure there are no syntax errors anywhere in the  tnsnames.ora file. Look for unmatched parentheses

Update .bash_profile File.

[crayon-5b2e6bf2dec0d870707729/] If you are using the standard Oracle client, the Database attribute value must specify a valid service name defined in tnsnames.ora which is located in $ORACLE_HOME/network/admin/tnsnames.ora For example, for the following tnsnames.ora entry, the Database attribute value needs to be orcldb:
[crayon-5b2e6bf2dec1b902085438/] If we do not use tnsnames.ora , we can use SQL connection string , connection string format below:
[crayon-5b2e6bf2dec20723847688/]  

 

Check Also

ORA-00920

ORA-00920 ORA-00920: invalid relational operator tips is a syntax issue and can easily be resolved …

ORA-00922

ORA-00922 ORA-00922: missing or invalid option is one of many Oracle errors, which does not …

Leave a Reply