Shutting down and restarting a Db2 instance
You can temporarily shut down a Db2 instance that you are not using to reduce resource consumption.
Shutting down an instance
- Run the following command to retrieve a list of your instances for Db2uCluster and Db2uInstance:
Find theoc get db2ucluster,db2uinstance --all-namespacesinstance_idof the instance that you want to shut down and export it withexport INSTANCE=<instance_id>. - Run the following command for Db2uCluster or Db2uInstance
to patch on the instance that you want to shut down:
For Db2uCluster:
oc patch db2u ${INSTANCE} -n ${PROJECT_CPD_INST_OPERANDS} --type=merge --patch '{"metadata": {"annotations": {"db2u.databases.ibm.com/maintenance-shutdown": "true"}}}'For Db2uInstance:
oc patch db2 ${INSTANCE} -n ${PROJECT_CPD_INST_OPERANDS} --type=merge --patch '{"metadata": {"annotations": {"db2u.databases.ibm.com/maintenance-shutdown": "true"}}}' - Wait for the Db2uCluster or Db2uInstance to show
Readystatus underSTATEandShutdownstatus underMAINTENANCESTATE. - Ensure that the engine pod and the etcd pod have been terminated.
Restarting an instance
- Run the following command to retrieve a list of your instances for Db2uCluster and Db2uInstance:
Find theoc get db2ucluster,db2uinstance --all-namespacesinstance_idof the instance that you want to restart. - Run the following command on the instance that you want to restart:
For Db2uCluster:
oc patch db2u ${INSTANCE} -n ${PROJECT_CPD_INST_OPERANDS} --type=merge --patch '{"metadata": {"annotations": {"db2u.databases.ibm.com/maintenance-shutdown": "false"}}}'For Db2uInstance:
oc patch db2 ${INSTANCE} -n ${PROJECT_CPD_INST_OPERANDS} --type=merge --patch '{"metadata": {"annotations": {"db2u.databases.ibm.com/maintenance-shutdown": "false"}}}' - Wait for the Db2uCluster or Db2uInstance to show
Readystatus underSTATEandNonestatus underMAINTENANCESTATE. - Ensure that the engine pod and the etcd pod are started and running.