totn Oracle Error Messages

Oracle / PLSQL: ORA-12154 Error Message

Learn the cause and how to resolve the ORA-12154 error message in Oracle.

Description

When you encounter an ORA-12154 error, the following error message will appear:

  • ORA-12154: TNS:could not resolve service name

Cause

You tried to connect to Oracle, but the service name is either missing from the TNSNAMES.ORA file or is incorrectly defined.

Resolution

The option(s) to resolve this Oracle error are:

Option #1

Make sure that the TNSNAMES.ORA file exists and is in the correct directory.

Option #2

Make sure that the service name that you are connecting to is included in the TNSNAMES.ORA file and that it is correctly defined.

Option #3

Make sure that there are no syntax errors in the TNSNAMES.ORA file. For example, if there are unmatched parentheses in the file (ie: open bracket without the corresponding close bracket), the file will be rendered unusable.