Skip to main content

Oracle TNS Alias OCI Configuration

When connecting to Oracle using the OCI Driver, you can create a TNS Alias configuration to use in your database connection object in IguanaX. This method will work with all operating systems.

STEP 1: Install and setup the required Oracle OCI Drivers

The Oracle ODBC package depends on the OCI drivers — so you need to set them up first. Follow the procedure in: Oracle OCI Driver Setup.

STEP 2: Create a tns_alias in the tnsnames.ora file in your netowrk admin directory

If the network admin directory does not exist, create it within your instantclient directory:

  • Windows: C:\Oracle\instanclient_X_Y\network\admin

  • Linux: /usr/lib/instanclient_X_Y/network/admin

Your database name (or tns_alias) can be defined in the Network Configuration File, tnsnames.ora. This file uses the following format:

<tns_alias>=   
(DESCRIPTION=
(ADDRESS=(PROTOCOL = TCP)(HOST = hostname)(PORT = portnum))
(CONNECT_DATA=
(SERVICE_NAME= <service_name>)))

For example:

STEP 3: Add a timeout to your sqlnet.ora file in your network admin directory

If sqlnet.ora does not exist, create it.

This tells the Oracle client to time out if a connection to the Oracle server cannot be obtained within the specified number of seconds (the example uses 5 seconds). The default is to never time out, which can cause problems if the server is down or cannot be reached.