Performing snapshot backups using object-copy based backup

You can perform a snapshot backup of your Db2® Warehouse database on Red Hat OpenShift by using an object-copy based backup of the cloud object storage objects.

About this task

Note: This procedure is for users who have Native Cloud Object Storage (NCOS) enabled. If you do not have NCOS enabled, refer to Performing a snapshot backup with Db2 Warehouse container commands for snapshot backup steps.

Backup solutions through object storage bucket file copy usually lack the ability to perform snapshots of content in the bucket. These backup solutions require very long running background processing to identify all objects and perform the copy.

As a result, users must follow extra steps to suspend object storage deletes before the backup is run and then resume the object storage deletes after the file copy process completes. These steps should comply with standards for running a command against a catalog pod.

Procedure

  1. Identify your Db2 Warehouse catalog pod:
    DB2_CAT_POD=$(oc get po -l app=${DB2_CR},name=dashmpp-head-0)
  2. Before you suspend, run this command with the -cos flag:
    oc exec -it -- ${DB2_CAT_POD} manage_snapshots --action suspend -cos
  3. 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-db2wh-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.

  4. Confirm that Db2 Warehouse high availability monitoring is disabled and the database is suspended by issuing the following command:
    oc exec -it ${DB2_CAT_POD} -- wvcli system status
  5. Take the snapshot of the persistent volume claim and volume claim templates at the storage layer. The steps differ depending on your storage provider.
  6. Initiate the object storage bucket file copy as per your storage provider.
  7. Resume writes to the database:
    oc exec -it ${DB2_CAT_POD} -- manage_snapshots --action resume
    
  8. Confirm that Db2 high availability monitoring is re-enabled and the database is taken out of write suspend by issuing this command:
    oc exec -it ${DB2_CAT_POD} -- wvcli system status
  9. When the object storage bucket file copy completes, resume deletes:
    oc exec -it ${DB2_CAT_POD} -- manage_snapshots --action resume -cos

Results

You can restore a snapshot backup of your Db2 Warehouse database that includes the use of Object-copy backups by putting your database in maintenance mode.

You can then restore your volume snapshots and your cloud object storage bucket used for Native COS back to the point in time of the snapshot backup. See Performing a snapshot restore with Db2 Warehouse container commands for detailed steps.