Performing Full Backup
IBM Db2 supports the following types of full backups:
To back up database offline, do the following steps:
- Offline backup requires downtime. During the downtime, the database is offline and inaccessible to applications. To prepare the database, do the following steps:
- 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 |
- Deactivate the database you want to back up offline with the following commands:
db2 deactivate database <database_name> |
where <database_name> is the name of the database you want to deactivate.
- Back up the database offline with the following command:
db2 backup database <database_name> load /opt/veeam/VeeamPluginforDB2/libDB2Plugin.so |
where <database_name> is the name of the database you want to back up.
- Re-activate the database.
db2 activate database <database_name> |
where <database_name> is the name of the database you want to deactivate.
To back up database online, do the following steps:
- 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 the name of the database you want to back up.
- 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 the 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 the name of the database you want to back up.
To learn more about the INCLUDE LOGS option, see this IBM article.