skip to main content
Connection Option Descriptions : TNSNames File

Try DataDirect Drivers Now

TNSNames File


TNSNamesFile (TNF)


Specifies the name of the TNSNAMES.ORA file. In a TNSNAMES.ORA file, connection information for Oracle services is associated with an Oracle net service name. The entry in the TNSNAMES.ORA file specifies Host, Port Number, and Service Name or SID.
TNSNames File is ignored if no value is specified in the Server Name option. If the Server Name option is specified but the TNSNames File option is left blank, the TNS_ADMIN environment setting is used for the TNSNAMES.ORA file path. If there is no TNS_ADMIN setting, the ORACLE_HOME environment setting is used. On Windows, if ORACLE_HOME is not set, the path is taken from the Oracle section of the Registry.
Using an Oracle TNSNAMES.ORA file to centralize connection information in your Oracle environment simplifies maintenance when changes occur. If, however, the TNSNAMES.ORA file is unavailable, then it is useful to be able to open a backup version of the TNSNAMES.ORA file (TNSNames file failover). You can specify one or more backup, or alternate, TNSNAMES.ORA files.

Valid Values

is the entire path, including the file name, to the TNSNAMES.ORA file.


To specify multiple TNSNAMES.ORA file locations, separate the names with a comma and enclose the locations in parentheses (you do not need parentheses for a single entry). For example:
(F:\server2\oracle\tnsnames.ora, C:\oracle\product\10.1\db_1\network\admin\tnsnames.ora)
The driver tries to open the first file in the list. If that file is not available, then it tries to open the second file in the list, and so on.
Connection Retry Count and Connection Retry Delay are also valid with TNSNames failover. The driver makes at least one attempt to open the files, and, if Connection Retry Count is enabled, more than one. If Connection Retry Delay is enabled, the driver waits the specified number of seconds between attempts. Load Balancing is not available for TNSNames failover.


*This option is mutually exclusive with the LDAP Distinguished Name, Host, Port Number, SID, and Service Name (ServiceName) options.
*By default, if no value is specified for the Service name or SID in the tnsnames.ora file, the driver will use the SID or service name specified by the DEFAULT_SERVICE_LISTENER property in the server-side listener.ora file.


None. If no values is specified for either the LDAP Distinguished Name, SID, Service Name, or TNSNames option, the driver attempts to connect to the ORCL SID by default.


General tab

See Also

*Connection Retry Count
*Connection Retry Delay