To complete common administration tasks, you must be able to run the exec command on the
Db2 pod.
Before you begin
To be able to copy commands and run them on your system without modification, complete a one-time
setup of a variety 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 resource name and create a db2ucluster environment
variable by running the following commands:
oc get db2ucluster --all-namespaces
export DB2_CR=<db2ucluster_resource_name>
-
Find the name of your Db2 pod for your database deployment:
db2_podname=$(oc -n ${PROJECT_CPD_INST_OPERANDS} get po --selector name=dashmpp-head-0 | grep ${DB2_CR} | awk {'print $1'})
-
Run the exec command to exec into the Db2 pod:
oc -n ${PROJECT_CPD_INST_OPERANDS} exec -it ${db2_podname} -- bash