Why Does an Error Show when I Create an Access Token for Oracle Database?

Symptoms

When I create an access token for Oracle database, this error shows:

ORA-12154 TNS could not resolve the connect identifier specified

Cause

The Oracle server does not use the file tnsnames.ora in the local system.

Good to Know

  • These rules apply to the connection string:
    • You can copy the connection string format from the file ~\11.2.0\dbhome_1\NETWORK\ADMIN\tnsnames.ora if it exists.
    • If you want to use SID instead of Service Name, the connection string will be different than the example in this procedure.
    • The Port field must be empty.

Resolution

  1. On the Access Token for Database, in the Database Server Name field, enter the database connection string in this format.

    Format:

    (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=[Oracle server host name])(PORT=[port number])) (CONNECT_DATA=(SERVICE_NAME=[service name])))

    Example:

    (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.88.1)(PORT=1521)) (CONNECT_DATA=(SERVICE_NAME=Orcl)))

  2. In the Port field, remove the port number if necessary.
  3. To make sure the specified database account is correct, click Test connection.