Setting the Oracle environment variables

The Oracle environment variables must be set in the db2dj.ini file on the federated server.

About this task

Restrictions

Review the restrictions for the db2dj.ini file.

The db2dj.ini file contains configuration information about the Oracle client software that is installed on the federated server.

There are required and optional environment variables for Oracle data sources.

If you installed the Oracle client software before you installed the Oracle wrapper, the required Oracle environment variables are set in the db2dj.ini file.

If you did not install the Oracle client software before you installed the Oracle wrapper, or if you want to set any of the optional environment variables you must set the environment variables by using the steps in this task.

Procedure

  1. Use one of the following methods:
    Method Description
    Automatically set the environment variables. Run the Federation component installation wizard. Follow the instructions in the wizard.
    Important: Set the required environment variables by running the installation wizard. The optional environment variables must be set manually.
    Manually set the environment variables. Edit the db2dj.ini file:
    The db2dj.ini file is located in the directory that the Db2® registry variable DB2_DJ_INI specifies. When the DB2_DJ_INI variable is not set, the db2dj.ini file is in one of the following default paths depending on the operating system:
    • On Linux® and UNIX: instancehome/sqllib/cfg/db2dj.ini.
      instancehome
      The home directory of the instance owner.
    • On Windows: %DB2PATH%\cfg\db2dj.ini
      %DB2PATH%
      The directory where the Db2 database system is installed, for example, C:\Program Files\IBM\sqllib.

    If the file does not exist, you can create a file with the name db2dj.ini by using any text editor. In the db2dj.ini file, you must specify the fully qualified path in the value of the environment variables; otherwise you will encounter errors.

  2. On federated servers that run UNIX, add the Oracle environment variable to the .profile file of the Db2 instance.
    For example:
    
    export ORACLE_HOME=oracle_home_directory
    export PATH=$ORACLE_HOME/bin:$PATH

    Where oracle_home_directory is the directory where the Oracle client software is installed.

  3. On federated servers that run Linux or UNIX, execute the Db2 instance .profile file by entering:
    
    . $HOME/ .profile
    
  4. To ensure that the environment variables are set on the federated server, recycle the Db2 instance with these commands:
    
    db2stop
    db2start
    

What to do next

After you complete this task, you can set up and test the Oracle client.