Setting up and testing the Oracle client configuration file

The Oracle client configuration file is used to connect to Oracle databases, by using the client libraries that are installed on the federated system.

About this task

The client configuration file specifies the location of each Oracle database server and type of connection (protocol) for the database server.

The default name for the Oracle client configuration file is tnsnames.ora.

The default location of the client configuration file depends on the operating system that is used by the federated system:
  • On Linux® and UNIX systems, the default location of the file is $ORACLE_HOME/network/admin.
  • On Windows systems, the default location of the file is %ORACLE_HOME%\NETWORK\ADMIN.

Procedure

  1. Create the tnsnames.ora using the Oracle NET8/NET Configuration utility that comes with the Oracle client software.

    Within the tnsnames.ora file, the SID (or SERVICE_NAME) is the name of the Oracle instance, and the HOST is the host name where the Oracle server is located.

  2. If you want to place the tnsnames.ora file in a path other than the default search path, set the TNS_ADMIN environment variable to specify the file location:
    1. Edit the db2dj.ini file in the sqllib/cfg directory, and set the TNS_ADMIN environment variable. For example:
      
      TNS_ADMIN=x:/path/
    2. Issue the following commands to recycle the Db2® instance and ensure that the environment variable is set in the program:
      
      db2stop
      db2start
      
  3. Test the connection to ensure that the client software can connect to the Oracle server. Use the Oracle sqlplus utility to test the connection.

What to do next

After you complete this task, you can register the Oracle wrapper.