Monday, 3 September 2007

ORA-12154: TNS: could not resolve service name

The ORA-21254 is a very common error, always related to your local copy of the tnsnames.ora file, your listener configuration and your database name aliases.

  • Make sure that your listener is listening for the same service name that you are using.
  • Your service name might have an alias, so check for global (world) entries and local entries. Check $ORACLE_HOME/network/admin/tnsnames.ora.
  • Check your global_name setting with this SQL:
    SQL>SELECT * FROM GLOBAL_NAME;
The query value should match your init.ora parms for db_name and db_domain, You can change the global_name with an alter database commend, as follows:

SQL>alter database rename global_name to xxx;