Taking a snapshot backup with Db2 container commands

You can take a snapshot backup of your Db2 database by using container commands to momentarily pause operators that perform writes and then taking an online snapshot.

About this task

Snapshot backups have significant advantages over traditional backups. They are completed quickly, regardless of database size, and they allow for fast recovery. Also, snapshots do not affect many database operations, except momentarily pausing operations that perform writes.

Procedure

  1. Run the following command to identify your Db2 catalog pod:
    DB2_CAT_POD=$(oc get po -l app=${DB2_CR},name=dashmpp-head-0)
  2. Suspend operations on the catalog pod by running the following command:
    oc exec -it -- ${DB2_CAT_POD} -- manage_snapshots --action suspend
  3. Confirm that Db2 high availability monitoring is disabled and the database is suspended by issuing the following command:
    oc exec -it ${DB2_CAT_POD} -- wvcli system status
  4. Take the snapshot of the persistent volume claim and volume claim templates at the storage layer. The steps differ depending on your storage provider:
  5. Resume writes to the database:
    oc exec -it ${DB2_CAT_POD} -- manage_snapshots --action resume
  6. Confirm that Db2 high availability monitoring is re-enabled and the database is taken out of write suspend by issuing the following command:
    oc exec -it ${DB2_CAT_POD} -- wvcli system status

What to do next

For instructions on the recommended restore option, see Restoring from a snapshot backup with Db2 container commands.