Catalog a Db2 database to use database
scripts in your before-job and after-job subroutines.
Procedure
-
Log in to the Red Hat OpenShift client as a cluster admin.
- 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
- Catalog the Db2 entry.
- Set the value of the environment variable
DB2INSTANCE to
dsuser.
export DB2INSTANCE=dsuser
- 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 ;
- Run the following commands on the db2-prompt.
- 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
- 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
- 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