Performing Incremental Backup

After you created a full backup of the database, you can create the following types of incremental backups:

  • An incremental backup. The incremental backup contains all database data that has changed since the last successful full backup.
  • An incremental delta (or delta) backup. The delta backup contains all database data that has changed since the last successful full, incremental, or delta backup.

Important

To create incremental and delta backups, you must set the trackmod parameter before you create a full backup. For details, see Preparing Database.

You can create both incremental and delta backups offline and online. For details, see the following subsections:

Offline Backup

To back up database offline, do the following steps:

  1. Offline backup requires downtime. During the downtime, the database is offline and inaccessible to applications. To prepare the database, do the following steps:
  1. Find all the applications with existing connections to IBM Db2.

db2 list applications

This command returns a list of all existing connections. To stop these connections, you can close the applications manually or you can disconnect all connections to all IBM Db2 databases with the following command:

db2 force application all

  1. Deactivate the database you want to back up offline with the following commands:

db2 deactivate database <database_name>

where <database_name> is a name of the database you want to deactivate.

  1. Depending on the type of the backup you want to create, back up the database offline with one of the following commands:

db2 backup database <database_name> incremental load /opt/veeam/VeeamPluginforDB2/libDB2Plugin.so

where <database_name> is a name of the database you want to back up.

db2 backup database <database_name> incremental delta load /opt/veeam/VeeamPluginforDB2/libDB2Plugin.so

where <database_name> is a name of the database you want to back up.

  1. Re-activate the database.

db2 activate database <database_name>

where <database_name> is a name of the database you want to deactivate.

Online Backup

Depending on the type of the backup you want to create, back up the database online with one of the following commands:

db2 backup database <database_name> online incremental load /opt/veeam/VeeamPluginforDB2/libDB2Plugin.so

where <database_name> is a name of the database you want to back up.

db2 backup database <database_name> online incremental delta load /opt/veeam/VeeamPluginforDB2/libDB2Plugin.so

where <database_name> is a name of the database you want to back up.

If you want to include logs in the backup, you can use the INCLUDE LOGS option with the BACKUP DATABASE command:

db2 backup database <database_name> online load /opt/veeam/VeeamPluginforDB2/libDB2Plugin.so include logs

where <database_name> is a name of the database you want to back up.

To learn more about the INCLUDE LOGS option, see this IBM article.

Page updated 10/23/2024

Page content applies to build 12.2.0.334