To do some common administration tasks, you must be able to run the exec command on the
Db2
Warehouse pod with catalog partition.
Before you begin
To be able to copy commands and run them on your system without modification, complete a one-time
setup of installation environment variables. For example, the PROJECT_CPD_INST_OPERANDS environment variable defines the namespace of your
database deployment. For more information, see Setting up installation
environment variables.
Procedure
- Find the respective Db2uCluster or Db2uInstance
resource names and create Db2uCluster or Db2uInstance
environment variables:
oc get db2ucluster,db2uinstance --all-namespaces
- Set the Db2uCluster or Db2uInstance custom resource name to the DB2_CR_ID
environment variable:
DB2_CR_ID=<db2ucluster_cr_name/db2uinstance_cr_name>
-
Find the name of your Db2
Warehouse pod for your database deployment:
db2_podname=$(oc -n ${PROJECT_CPD_INST_OPERANDS} get po --selector name=dashmpp-head-0 | grep ${DB2_CR_ID} | awk {'print $1'})
-
Run the exec command to exec into the Db2
Warehouse pod:
oc -n ${PROJECT_CPD_INST_OPERANDS} exec -it ${db2_podname} -- bash