0 / 0

Cataloging a Db2 database in the DataStage runtime container

Last updated: Mar 12, 2025
Cataloging a Db2 database in the DataStage runtime container

Catalog a Db2 database to use database scripts in your before-job and after-job subroutines.

About this task

Procedure

  1. Log in to the Red Hat OpenShift client as a cluster admin.
  2. Log in to the DataStage® runtime container.
    pod=`oc get pods | grep -i ds-px-default | grep -i px-runtime|grep -i Running | awk '{print $1}'`
    echo $pod
    oc rsh $pod
    
  3. Catalog the Db2 entry.
    1. Set the value of the environment variable DB2INSTANCE to dsuser.
      export DB2INSTANCE=dsuser
    2. Go to the directory /home/dsuser/sqllib/bin and rum the command db2 to go to the db2-prompt.
      cd /home/dsuser/sqllib/bin ; ./db2 ;
    3. Run the following commands on the db2-prompt.
    4. Create catalog entry for remote Db2 node:

      Syntax:

      CATALOG TCPIP NODE db2CatalogName REMOTE REMOTE-DB2-HOSTNAME SERVER DB2-PORT 
      

      Example:

      CATALOG TCPIP NODE myDB2 REMOTE YAWLS1.FYRE.IBM.COM SERVER 50000
      
    5. Create catalog entry for remote Db2 database:

      Syntax:

      CATALOG DATABASE databaseName AT NODE db2CatalogName AUTHENTICATION SERVER
      

      Example:

       CATALOG DATABASE SAMPLE AT NODE myDB2 AUTHENTICATION SERVER
    6. Connect to the remote Db2 database (by running the command /home/dsuser/sqllib/db2).

      Syntax:

       CONNECT TO SAMPLE USER db2User USING db2Password
      

      Example:

      CONNECT TO SAMPLE USER db2inst1 USING db2inst1