Setting IBM DB2 Universal Database environment variables

The IBM DB2 Universal Database installation provides two scripts, one of which needs to be sourced to set up the IBM DB2 Universal Database environment variables: db2cshrc for C shell and db2profile for Bourne or Korn shell. These scripts set library paths based on the bit size of the server or client that was installed.

For a 64-bit IBM DB2 Universal Database server or client, the paths point to the 64-bit libraries. However, except on HP Itanium, Replication Agent and ECDA require library paths to point to the 32-bit IBM DB2 Universal Database libraries. To correctly set the IBM DB2 Universal Database environment variables for Replication Agent and ECDA, you need to customize either of these script files. However, do not change the original scripts, because they may be changed when you apply a FixPak to the IBM DB2 Universal Database server or client.

StepsTo set IBM DB2 Universal Database environment variables to use 32-bit libraries

  1. Navigate to the IBM DB2 Universal Database server or IBM DB2 Universal Database client sqllib directory, which is located in the IBM DB2 Universal Database user home directory. For example:

    cd ~dbsinst1/sqllib
    
  2. Based on the type of UNIX shell you are using, copy either the db2cshrc or db2profile script:

    • For C shell:

      cp db2cshrc mydb2cshrc
      
    • For Bourne or Korn shell

      cp db2profile mydb2profile
      
  3. Edit your copy of the file. Add a statement at the very end of the file that sets the platform-specific library path variable to point to the 32-bit IBM DB2 Universal Database libraries. For example, on Solaris, add these lines:

    • For C shell, in mydb2cshrc:

      # force 32-bit libraries
      	setenv LD_LIBRARY_PATH $DB2DIR/lib32:$LD_LIBRARY_PATH 
      
    • For Bourne or Korn shell, in mydb2profile:

      # force 32-bit libraries
      	LD_LIBRARY_PATH=$DB2DIR/lib32:$LD_LIBRARY_PATH
      	export LD_LIBRARY_PATH
      
  4. Before starting either Replication Agent or ECDA, always source your file—rather than the original db2cshrc or db2profile—to set the IBM DB2 Universal Database environment variables.