Important: IBM® Cloud Pak for
Data
Version 4.5 will reach end of support (EOS) on 31 July, 2025. For more information, see the
Discontinuance of service announcement for
IBM Cloud Pak for
Data Version 4.X.
Upgrade to IBM Software Hub Version
5.1 before IBM Cloud Pak for
Data Version 4.5 reaches end of
support. For more information, see Upgrading IBM Software Hub in the IBM Software Hub Version 5.1
documentation.
For a Db2® deployment, the
method for the BLUDB database backup is to use a Single System View (SSV) backup.
This strategy helps you back up all database partitions simultaneously, including the catalog
partition. SSV backups provide a single time-stamp for all database partitions, making the recovery
simpler. The db2 backup command must be run from the node where the Db2 database service is deployed.
Before you begin
- For an offline backup, the database is offline and inaccessible to applications during backup,
but there are no ongoing transactions that need to be added to the backup.
- You must identify the Db2 catalog
node and have an SSH connection to the catalog node. For more information, see Preparing to back up or restore Db2.
Procedure
-
From a bash shell on the catalog node, switch to the database instance owner and create the
directory to hold the backup images:
su - db2inst1
mkdir /backup_dir/backup_nnn
Where
backup_dir is the directory that you create to hold backup images and
nnn is an incremental value that puts each backup in a separate subdirectory. The
backups can be put into any directory on the cluster that is shared by the container nodes and has
sufficient space to hold the backups. If you back up into a different directory, alter these
commands as necessary.
-
Temporarily disable the built-in HA:
sudo wvcli system disable -m "Disable HA before Db2 maintenance"
-
Connect to the database:
-
Find all the applications that are connected to Db2:
db2 list applications
This command returns a list
of all currently connected applications. You can either stop all the connections by closing the
applications, or you can enter the following command to disconnect all
connections:
db2 force application all
-
Issue the terminate database command:
-
Stop the database:
db2stop force
Ensure that the command completes on all nodes.
-
Ensure that all Db2 interprocess
communications are cleaned for the instance:
-
Turn off all communications to the database by setting the value of the DB2COMM variable to
null:
-
Restart the database in restricted access mode:
db2start admin mode restricted access
-
Run the offline backup with the command:
db2 backup db BLUDB on all dbpartitionnums to backup_dir
Where
backup_dir is the full path to the directory you created in Step 1.
The offline backup is run and returns a successful
result:
Part Result
---- ------------------------------------------------------------------------
0000 DB20000I The BACKUP DATABASE command completed successfully.
0001 DB20000I The BACKUP DATABASE command completed successfully.
0002 DB20000I The BACKUP DATABASE command completed successfully.
Backup successful. The timestamp for this backup image is : 20190523210916
-
Halt the restricted access mode:
-
Ensure that all Db2 interprocess communications are cleaned for the instance:
-
Reinitialize the Db2 communication
manager to accept database connections:
-
Restart the database for normal operation:
-
Activate the database:
-
As the root user, re-enable the built-in HA monitoring:
sudo wvcli system enable -m "Enable HA after Db2 maintenance"
-
Confirm that the built-in HA monitoring is active:
sudo wvcli system status
sudo wvcli system devices
-
Connect to the database:
- Run the following command to copy over the two keystore files from the keystore directory
into the backup
directory.
cp ${KEYSTORELOC}/* ${BACKUPDIR}
Restoring from an
encrypted backup requires the following two files:
keystore.p12
keystore.sth
What to do next
For instructions on the recommended restore option, see Restoring Db2 from an offline backup using the restore script.