Performing Full Backup

IBM Db2 supports the following types of full backups:

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. Back up the database offline with the following command:

db2 backup database <database_name> 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

To back up database online, do the following steps:

  1. Before you back up database online, check if you set Veeam Plug-in to use the logarchmeth1 parameter.

If you have not configured the logarchmeth1 parameter during the Veeam Plug-in configuration, you can configure the parameter using DB2ConfigTool:

DB2ConfigTool --set-logarchmeth yes

Alternatively, you can re-configure the database with the following command:

db2 update database cfg for <database_name> using logarchmeth1 VENDOR:</opt/veeam/VeeamPluginforDB2/libDB2Plugin.so>

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

  1. Back up the database online with the following command:

db2 backup database <database_name> online 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.