Jump to: navigation, search

Configure unixODBC for DB2 on Linux 32 or 64

  1. In $DRIVER/clidriver/cfg:
    1. rename db2cli.ini.sample to db2cli.ini
    2. Rename db2dsdriver.cfg.sample to db2dsdriver.cfg
    3. Modify the <dsncollection> element of db2dsdriver.cfg by inserting
      <dsn alias="DB2_ALIAS" name="DB2_NAME" host="db2host.<your company>.com" port="5000"?> <parameter name="Authentication" value="Client"/></dsn>
    4. Modify the <databases> element of db2dsdriver.cfg by inserting
       <database name="DB2_NAME" host="db2host.<your company>.com" port="5000"?>
       <parameter name="CurrentSchema" value="DB2I"/>
       <wlb> <parameter name="enableWLB" value="true"/><parameter name="maxTransports" value="50"/></wlb>
       <acr> <parameter name="enableACR" value="true"/> </acr>
      
    5. Modify $HOMEDIR/.odbc.ini by adding the following:
      [DB2_ALIAS]
      Description=my DB2
      Driver=DB2_DRIVER
  2. Modify odbcinst.ini in $UNIXODBC/etc/ by adding the following:
    [DB2_DRIVER]
    Description=DB2 ODBC Driver
    Driver=$DRIVER/clidriver/lib/libdb2.so
    Fileusage=1
    DontDLClose=1
  3. Test the connection:
    ./isql -v DB2_ALIAS username password
This page was last edited on June 19, 2020, at 14:27.
Comments or questions about this documentation? Contact us for support!