When you need an online backup of your DB2 databases, then you have to switch to Archived Transactional Logging. This is the procedure to move over from circular to archived on (of course) a Linux platform.

First of all you need to prepare the destination of the archive logs, onlinebackups and restores. Perform as root.

mkdir /data/archives
chown db2inst1:db2iadm1 /data/archives
mkdir /data/onlinebackups
chown db2inst1:db2iadm1 /data/onlinebackups
mkdir /data/restore
chown db2inst1:db2iadm1 /data/restore

Now you need to change the database configuration to point to the new destination. Perform all other steps as user db2inst1.

db2 update database configuration for <dbname> using LOGARCHMETH1 'DISK:/data/archives'

When you now restart DB2, you can see the created folder structure for the database(s).

/data/archives/db2inst1/<dbname>/<NodeID>/<DBImageCopy>

Now you need to run a latest offline backup from all your changed databases.

db2 backup database <dbname> to /data/onlinebackups

Now we are ready to perform the first online backup.

db2 backup database <dbname> ONLINE to /data/onlinebackups COMPRESS INCLUDE LOGS


See my blog on restoring the database: https://www.angioni.nl/2021/01/01/restoring-an-online-backup-in-db2/

Visits: 364

By angioni

Leave a Reply

Your email address will not be published. Required fields are marked *

Time limit is exhausted. Please reload CAPTCHA.