Setting the Sybase environment variables

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

About this task


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.


  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
    The home directory of the instance owner.
    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:
    The directory path where the Sybase Open Client software is installed, for example:
    The name of the OCS directory SYBASE_OCS environment variable, for example:
    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
    The directory where the Sybase Open Client software is installed.
    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:

What to do next

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