Easysoft ODBC-Oracle Driver

Why do I get error "ORA-12154: TNS:could not resolve the connect identifier specified"?

Article:
00951
Last Reviewed:
4th January 2024
Revision:
1

This error indicates that Oracle is unable to locate the service name specified in your Easysoft ODBC-Oracle Driver ODBC data source. You need to check the Database attribute value in the data source.

If you are using the standard Oracle client, the Database attribute value must specify a valid service name defined in tnsnames.ora. For example, for the following tnsnames.ora entry, the Database attribute value needs to be my_database:

my_database =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = my_host)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = my_database)
    )
  )

If you are using the Instant Client without a tnsnames.ora file, the Database attribute value needs to be a SQL connect URL rather than a service name:

//host:port/service_name

where host is the host name or IP address of the Oracle database server, port is the Oracle listener port and service_name is the service name. For example:

//my_host:1521/my_database

If you want to use the Instant Client with a tnsnames.ora file, the Database attribute value must specify a tnsnames.ora service name and you need to set and export the TNS_ADMIN environment variable. Set TNS_ADMIN to specify the location of the tnsnames.ora file. For example:

TNS_ADMIN = /home/oracle/network/admin
export TNS_ADMIN
Applies To

Knowledge Base Feedback

* Did this content help you?
* Please select one option based on your first choice:

(* Required Fields)