Restore to Original Server

You can restore IBM Db2 databases from backups stored on Veeam backup repositories in the following ways:

Restore from Full Backup

To restore a IBM Db2 database from a full backup, use the following command:

db2 restore db <database_name> load /opt/veeam/VeeamPluginforDB2/libDB2Plugin.so taken at <timestamp>

where:

To learn how to get time stamp, see Get Backup Time Stamp.

Restore from Incremental Backup

To restore a IBM Db2 database from a full backup, use the following command:

db2 restore db <database_name> incremental automatic load /opt/veeam/VeeamPluginforDB2/libDB2Plugin.so taken at <timestamp>

where:

To learn how to get time stamp, see Get Backup Time Stamp.

Restore to Previous State

You can restore the database to the previous states. In this case, you restore database from a backup, then apply archive logs that are available in the backup file. With these archive logs, you can restore database to the exact state when the backup was created.

Important

To restore database to the previous state, you must use a full online backup of the database. To learn more, see Performing Full Backup.

To restore database to the previous state, do the following steps:

  1. Restore to the previous state requires downtime. Terminate all existing connections and deactivate the database with the following commands:

db2 terminate

db2 deactivate database <database_name>

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

  1. Extract archive logs from the backup file with the following command:

db2 restore database <database_name> logs load /opt/veeam/VeeamPluginforDB2/libDB2Plugin.so LOGTARGET <path_to_logs>

where:

  1. Return the database to the state recorded in a backup with the following command:

db2 restore database <database_name> load /opt/veeam/VeeamPluginforDB2/libDB2Plugin.so taken at <timestamp> replace existing

where:

To learn how to get time stamp, see Get Backup Time Stamp.

  1. Apply archive logs to return database to the exact state when the backup was created with the following command:

db2 rollforward database <database_name> to end of logs overflow log path (<path_to_logs>)

where:

  • <database_name> is a name of the database you want to deactivate.
  • <path_to_logs> is a path to the directory to which Veeam Plug-in will extract archive logs.
  1. Recover the database with the following command:

db2 recover database <database_name>

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

  1. Re-activate the database with the following command:

db2 activate database <database_name>

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

 

Page updated 12/20/2024

Page content applies to build 12.3.0.310