KNOWLEDGE BASE

Error "ORA-12154" Connecting to Oracle When Not Using TNSNames.ora


Published: 01 Aug 2014
Last Modified Date: 28 Apr 2017

Issue

When you create a new connection to an Oracle database, or try to open a published workbook that is connected to an Oracle database, where all three connection parameters (Server, Service, and Port) were configured during the initial connection, the following error might occur:

Oracle database error 12154: ORA-12154: TNS:could not resolve the connect identifier specified

When you try to connect to the same Oracle database using the service name from TNSNames.ora file in the Server parameter and leaving the other two parameters blank, the connection is successful.

Environment

  • Tableau Server
  • Tableau Desktop
  • Oracle

Resolution

Option 1:

Work with your Oracle database administrator to allow the HOSTNAME connection type for the Oracle client on the computer running Tableau Desktop or Tableau Server.

Option 2:

The following workaround may allow the HOSTNAME connection type:

  1. On the computer running Tableau Desktop or Tableau Server, find the sqlnet.ora file. The folder containing the file should be specified in the TNS_ADMIN variable and should also contain the TNSNames.ora file. For more information, see "Set the TNS_Admin environment variable" in Setting an Oracle Connection to Use TNSNames.ora and Sqlnet.ora at Oracle FAQ's.
    Note: If this folder does not contain a sqlnet.ora file, create a sqlnet.ora file.
  2. In the sqlnet.ora file, amend the NAMES.DIRECTORY_PATH line to say the following or add the following line to the sqlnet.ora file: 
    NAMES.DIRECTORY_PATH= (LDAP, TNSNAMES, HOSTNAME)
Note: If this issue occurs in a Tableau Server distributed environment, perform the above steps on all computers in the Tableau Server installation.

Cause

The sqlnet.ora file is not allowing the Oracle driver to look for the database using all three connection parameters.
Did this article resolve the issue?