Performing a snapshot backup with Db2 Warehouse container commands

You can run container commands against your Db2 instance to suspend write operations and take a snapshot backup of a Db2 Warehouse database.

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. Identify your Db2 Warehouse catalog pod:
    DB2_CAT_POD=$(oc get po -l app=${DB2_CR},name=dashmpp-head-0)
  2. Suspend operations on the database:
    oc exec -it ${DB2_CAT_POD} -- manage_snapshots --action suspend

    The manage_snapshots command might prompt you with a message that is similar to the example output below:

    The authenticity of host '[c-db2oltp-1611589677085880-db2u-0.c-db2oltp-1611589677085880-db2u-internal]:50022 ([10.254.13.10]:50022)' can't be established.
    RSA key fingerprint is SHA256:R9/ve/iF4j+2BKunEqEo5PGN19UoCYBsnbHWmEmlrbU.
    RSA key fingerprint is MD5:72:cb:84:3a:fa:36:0c:ed:45:96:1b:cd:f9:d4:67:99.
    Are you sure you want to continue connecting (yes/no)?

    If you see this message, type yes in the shell prompt to enable the script to update the known_hosts file to enable password-less SSH access.

  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 Using the restore script.