You can set up point-in-time recovery through continuous backup to support split-mirror
cloning of your database.
About this task
Point-in-time recovery refers to the recovery of data changes up to a given
timestamp. While there are many ways to use point-in-time recovery, this procedure lists steps for
snapshot backup for traditional storage and continuous backup for the cloud object storage.
Some cloud object storage providers provide the configuration of continuous backups that can be
restored to any point in time in various granularities. A cloud object storage provider such as AWS
S3 has a restore granularity set to the second. With point-in-time recovery, you benefit from using
a combination of snapshot backups over traditional storage and point-in-time snapshot over cloud
object storage to achieve significant advantages over traditional backups.
The steps in must comply with standards for running a command against a pod.
Procedure
- Identify your Db2®
Warehouse catalog pod:
DB2_CAT_POD=$(oc get po -l app=${DB2_CR},name=dashmpp-head-0)
-
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 similar to the
example below:
The authenticity of host '[c-db2wh-1611589677085880-db2u-0.c-db2wh-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.
-
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
-
Take the snapshot of the persistent volume claim and volume claim templates at the storage
layer. The steps differ depending on your storage provider:
- Take note of the timestamp in the cloud object storage provider that you used for Native
COS. You will need the exact timestamp to restore the contents of the cloud object storage bucket
back to their state at that specific point in time.
-
Resume writes to the database:
oc exec -it ${DB2_CAT_POD} -- manage_snapshots --action resume
-
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
Results
You can restore a snapshot backup of your Db2
Warehouse database that includes the
use of continuous backup for cloud object storage 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.