Performing Log Backup
To specify the method and location for archiving database logs, you must use the logarchmeth1 parameter.
- Automatic configuration: During the configuration of Veeam Plug-In for IBM Db2, the setup wizard automatically sets logarchmeth1 to direct logs to the Veeam backup repository. For more information, see Configuring Plug-In.
- Manual configuration: You can set logarchmeth1 and logarchmeth2 using IBM Db2 commands. For more information, see Performing Manual Archive Log Backup and Setting Additional Database Archive Log Configuration.
|
Note |
|
You must set Veeam Plug-In to use the logarchmeth1 parameter to enable and run online backups. Otherwise, only offline backups are possible. If you do not set the logarchmeth1 parameter in the configuration wizard, Veeam Plug-In will do the following, based on the current value of the parameter:
|
Performing Manual Archive Log Backup
Manually archive database logs using IBM Db2 commands in the following scenarios:
- To archive all recent transactions before a backup operation.
- To test archive log configuration.
- During troubleshooting or active log processing.
|
Note |
|
You must configure logarchmeth1 or logarchmeth2 parameters before using the db2 archive log for db <database_name> command. Based on this configuration, IBM Db2 sends the archived logs to the specified location. Manual archive log backup does not replace automatic log backup managed by Veeam Plug-In for IBM Db2. This command only archives the current log file. |
To manually archive the active log file, do the following on the machine running IBM Db2:
- Log in to the machine using a user account with root or instance owner privileges.
- Connect to the database instance environment.
- Run the following command:
|
db2 archive log for db <database_name> |
where <database_name> is the name of the database.
For example:
|
db2 archive log for db db1 |
- Confirm that the logarchmeth1 parameter is configured correctly.
|
db2 get database configuration for <database_name> |
where <database_name> is the name of the database.
This command displays database configuration settings. Verify that logarchmeth1 is set to the expected value.
- Check the archive log backup history to confirm that the log was archived.
|
db2 list history archive log all for <database_name> |
where <database_name> is the name of the database.
The output lists archived log entries and their Location. The Location should show Veeam Plug-In for IBM Db2 as the archive destination.
|
Note |
|
The archive log history confirms that IBM Db2 archived the log file. It does not confirm that the log was successfully transferred to the Veeam Backup & Replication backup repository. To verify that the log backup completed in Veeam Backup & Replication, do one of the following:
|
Setting Additional Database Archive Log Configuration
You can use the logarchmeth2 parameter in IBM Db2 databases to specify a secondary archive log method or location. Set this parameter in addition to the primary method defined by logarchmeth1.
To set the logarchmeth2 parameter, do the following on the machine running IBM Db2:
- Log in to the machine using a user account with root or instance owner privileges.
- Run the following command to set the logarchmeth2 parameter:
|
db2 update database configuration for <database_name> using logarchmeth2 <method> |
where:
- <database_name> is the required database name.
- <method> is the required archive log method or location.
For example:
- For Linux or Unix:
|
db2 update database configuration for db1 using logarchmeth2 DISK:/archive/secondary |
- For Microsoft Windows:
|
db2 update database configuration for db1 using logarchmeth2 DISK:C:\archive\secondary |
- Run the following command to verify the new value:
|
db2 get database configuration for <database_name> |
where <database_name> is the name of the database.
This command displays the updated logarchmeth2 setting.
|
Note |
|
The value for logarchmeth2 must be compatible with your backup and recovery requirements. If you use Veeam Plug-In for IBM Db2, ensure that the secondary archive method does not conflict with the backup configuration managed by Veeam Backup & Replication. |