Configuring Whether to Use tnsnames or Easy Connect Naming Method

If a sqlnet.ora file is present, it specifies the naming methods to be tried and the order in which to try them.

ODP.NET looks for a sqlnet.ora file with the following precedence:

  1. If the TNS_ADMIN environment variable has been set, ODP.NET looks in that specified location.

  2. If TNS_ADMIN has not been set, ODP.NET looks in the Oracle Database default location, as noted in Parameters for the sqlnet.ora File in Oracle Database Net Services Reference.

If sqlnet.ora is found, you can use only naming methods that are indicated there. If sqlnet.ora is not found, you can use either the tnsnames or easy connect naming method.

In TimesTen, sample copies of the tnsnames.ora and sqlnet.ora files are in the tt_installation_dir\network\admin\samples directory, where tt_installation_dir is the TimesTen installation root directory. The following is the sqlnet.ora file that TimesTen provides, which supports both the tnsnames naming method and the easy connect naming method.

# To use ezconnect syntax or tnsnames, the following entries must be
# included in the sqlnet.ora configuration.
NAMES.DIRECTORY_PATH= (TNSNAMES, EZCONNECT)

With this setting, ODP.NET first looks for tnsnames syntax in your connection strings. If it cannot find tnsnames syntax, it looks for easy connect strings.

Note:

Oracle Database network libraries are provided with ODP.NET. In a TimesTen environment, ODP.NET does not use the copy of the Oracle Database network libraries provided with the Instant Client shipped with TimesTen. (That location, for reference, is tt_installation_dir\ttoracle_home\instantclient for the Oracle Database 19c Instant Client shipped with TimesTen releases.)