DB2 10.5 for Linux, UNIX, and Windows

Archive logging

Archive logging is used specifically for rollforward recovery. Archived logs are log files that are copied from the current log path or from the mirror log path to another location. You can use the logarchmeth1 database configuration parameter, the logarchmeth2 database configuration parameter, or both to allow you or the database manager to manage the log archiving process.
Figure 1. Active and archived database logs in rollforward recovery . There can be more than one active log in the case of a long-running transaction.
Graphic showing more than one active log.

Taking online backups is supported only if you configure the database for archive logging. During an online backup operation, all activities against the database are logged. After an online backup is complete, the database manager forces the currently active log to close, and as a result, it is archived. This process ensures that your online backup has a complete set of archived logs available for recovery. When an online backup image is restored, the logs must be rolled forward at least to the point in time at which the backup operation completed. To facilitate this operation, archived logs must be made available when the database is restored.

You can use the logarchmeth1 and logarchmeth2 database configuration parameters to specify where archived logs are stored. You can use the logarchmeth1 parameter to archive log files from the active log path that is set by the logpath configuration parameter. You can use the logarchmeth2 parameter to archive additional copies of log files from the active log path to a second location. If you do not configure mirror logging, the additional copies are taken from the same log path that the logarchmeth1 parameter uses. If you configure mirror logging, with the mirrorlogpath configuration parameter, the logarchmeth2 configuration parameter archives log files from the mirror log path instead, which can improve resilience during rollforward recovery. The newlogpath parameter affects where active logs are stored.

In certain scenarios, you can compress archived log files to help reduce the storage cost that is associated with these files. If the logarchmeth1 and logarchmeth2 configuration parameters are set to DISK, TSM, or VENDOR, you can enable archived log file compression by setting the logarchcompr1 and logarchcompr2 configuration parameters to ON. If logarchcompr1 and logarchcompr2 are set dynamically, any log files that are already archived are not compressed.

If you use the LOGRETAIN option to specify a value that you want to manage the active logs, the database manager renames log files from the active log path after it archives these files and they are no longer needed for crash recovery. If you enable infinite logging, additional space is required for more active log files, so the database server renames the log files after it archives them. The database manager retains up to 8 extra log files in the active log path for renaming purposes.