Setting the Sybase environment variables

The Sybase 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 Sybase Open Client software that is installed on your federated server.

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

If you installed the Sybase Open Client software before you installed the Sybase wrapper, the required Sybase environment variables are set in the db2dj.ini file.

You must set the environment variables by using the steps in this task if you did not install the Sybase Open Client software before you installed the Sybase wrapper or you want to set any of the optional environment variables.

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 file that is specified by Db2® registry variable, DB2_DJ_INI. When this variable is not set, the default is as follows:
    Linux or UNIX
    instancehome/sqllib/cfg/db2dj.ini
    instancehome
    The home directory of the instance owner.
    Windows
    %DB2PATH%\cfg\db2dj.ini
    %DB2PATH%
    The directory where the Db2 database system is installed, for example: C:\Program Files\IBM\sqllib.
    If the db2dj.ini file does not exist, you must create it with a text editor by specifying the following Sybase environment variables:
    SYBASE
    The directory path where the Sybase Open Client software is installed, for example:
    SYBASE=/sybase
    SYBASE_OCS
    The name of the OCS directory SYBASE_OCS environment variable, for example:
    SYBASE_OCS=OCS-12_5 
    Important: Errors occur if the Sybase environment variables are not specified in the db2dj.ini file.
  2. On Linux and UNIX, you must update the .profile file that is on the federated database instance.

    Run the following commands to update the .profile file with the Sybase environment variables that you added to the db2dj.ini file:

    export SYBASE=sybase_home_directory
    export SYBASE_OCS=OCS-version_release 
    export PATH=$SYBASE/bin:$PATH
    
    sybase_home_directory
    The directory where the Sybase Open Client software is installed.
    sybase_ocs_directory
    The name of the OCS directory and is required.
  3. From the home directory, run the .profile file that is on federated database instance to initiate the Db2 database instance:
    . .profile
  4. On some operating systems, such as Linux, you must add the path of the Sybase client library to the DB2LIBPATH db2set variable, for example:
    db2set DB2LIBPATH=/opt/sybase125/OCS-12_5/lib
  5. To ensure that the environment variables are set on the federated server, you must recycle the federated database instance by stopping and restarting it with the following commands:
    db2stop
    db2start  

What to do next

After you complete this task, you must register the wrapper.