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
-
- Run the following command to retrieve a list of your instances:
Find theoc get db2u
instance_id
of the instance that you want to shut down and export it withexport INSTANCE=<instance_id>
. - 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"}}}'
- Wait for the db2ucluster to show
Ready
status underSTATE
andShutdown
status underMAINTENANCESTATE
. - Ensure that the catalog pod and the etcd pod have been terminated.
- Run the following command to retrieve a list of your instances:
- Restarting an instance
-
- Run the following command to retrieve a list of your instances:
Find theoc get db2u
instance_id
of the instance that you want to restart. - 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"}}}'
- Wait for the db2ucluster to show
Ready
status underSTATE
andNone
status underMAINTENANCESTATE
. - Ensure that the catalog pod and the etcd pod are started and running.
- Run the following command to retrieve a list of your instances: