Stopping and starting a Db2 instance

Stop and start a Db2 instance inside a container to perform maintenance tasks.

About this task

Db2 comes with a built-in High Availability (HA) solution that monitors and triggers recovery actions if there is a problem with Db2 database services. The built-in HA monitoring must be temporarily disabled before you stop and start Db2.

Procedure

  1. Exec into the Db2 pod.
  2. Temporarily disable the built-in HA:
    wvcli system disable -m "Disable HA before Db2 maintenance"
  3. Become the Db2 instance owner:
    su - ${DB2INSTANCE}
  4. Run the following command and perform the maintenance tasks that you want.
    db2stop
  5. When the maintenance tasks are completed, restart Db2 with the following command, and activate the database (for example, with the command db2 activate db BLUDB).
    db2start
  6. Re-enable the built-in HA monitoring:
    wvcli system enable -m "Enable HA after Db2 maintenance"
  7. Confirm that the built-in HA monitoring is active:
    wvcli system status
    Tip: You might have to run these commands several times before the HA status is shown as active.
    Note: For more information about shutting down a Db2 instance and Db2 cluster, see Shutting down and restarting Db2 custom resources in the Db2 documentation.