How to resolve "ORA-12154: TNS could not resolve service name" encountered while using Oracle as the database in TIBCO Statistica?

How to resolve "ORA-12154: TNS could not resolve service name" encountered while using Oracle as the database in TIBCO Statistica?

book

Article ID: KB0073482

calendar_today

Updated On:

Products Versions
Spotfire Statistica 13.3 or higher

Description

Oracle database can be used either as a metadata database or as a datasource in TIBCO Statistica and might encounter this error. This is a very common error mostly related to the local copy of the tnsnames.ora file or listener configuration or the database name aliases.
 
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.

Issue/Introduction

How to resolve "ORA-12154: TNS could not resolve service name" encountered while using Oracle as the database in TIBCO Statistica?

Resolution

Resolution 1 : Check if the indentation of the connection strings in the file tnsnames.ora is correct. Here is a sample string:

 LISTENER = (ADDRESS = (PROTOCOL = TCP)(HOST = myserver.example.com)(PORT = 1521))

Resolution 2 : Check if the file tnsnames.ora is placed exactly at the following location:
  " $ORACLE_HOME/network/admin/tnsnames.ora".

User-added image

 
Resolution 3 : Make sure that TNSNAMES is listed as one of the values of the  names.directory_path parameter in the  sqlnet.ora Oracle Net profile.

Resolution 4 : Check that the net service name used as the connect identifier exists in the  tnsnames.ora file.

Note : Make sure to have Administrative rights and the file tnsnames.ora is not in "Read-only" mode before making any of the changes.

Additional Information

ORA-12154: TNS tips (dba-oracle.com)