Shutting down and restarting a Db2 Warehouse instance

You can temporarily shut down a Db2 Warehouse instance that you are not using to reduce resource consumption.

You can run a patch to shut down specific Db2 Warehouse instances, while allowing other Db2 Warehouse instances to remain running.

Shutting down an instance
  1. Run the following command to retrieve a list of your instances:
    oc get db2u
    Find the instance_id of the instance that you want to shut down and export it with export INSTANCE=<instance_id>.
  2. Run the following patch on the instance that you want to shut down:
    oc patch db2u ${INSTANCE} -n ${PROJECT_CPD_INSTANCE} --type=merge --patch '{"metadata":  {"annotations": {"db2u.databases.ibm.com/maintenance-shutdown":  "true"}}}'
  3. Wait for the db2ucluster to show Ready status under STATE and Shutdown status under MAINTENANCESTATE.
  4. Ensure that the catalog pod and the etcd pod have been terminated.
Restarting an instance
  1. Run the following command to retrieve a list of your instances:
    oc get db2u
    Find the instance_id of the instance that you want to restart.
  2. Run the following patch on the instance that you want to restart:
    oc patch db2u ${INSTANCE} -n ${PROJECT_CPD_INSTANCE} --type=merge --patch '{"metadata":  {"annotations": {"db2u.databases.ibm.com/maintenance-shutdown":  "false"}}}'
  3. Wait for the db2ucluster to show Ready status under STATE and None status under MAINTENANCESTATE.
  4. Ensure that the catalog pod and the etcd pod are started and running.