Understanding the DB2 log manager

Data Protection for SAP for DB2® is integrated with the built-in DB2 log manager.

When Data Protection for SAP is registered within the DB2 database configuration, the DB2 log manager uses Data Protection for SAP for archiving and retrieving log files.

Log files that are used in an SAP environment are in one of these four states:
Online active
The log file is used by DB2 for current logging transactions.
Online retained
The log file is not used by DB2 for current logging transactions. However, it contains transactions with unwritten data pages. An unwritten data page is a page that is not received data from the buffer pool to disk. As a result, the log file is needed by DB2 to do a crash recovery or rollback operation. The DB2 log manager copies a filled online log file to a possible archive location. Do not use operating system commands for copying online log files.
Offline retained
The log file is not used by DB2 for current logging transactions and it does not contain transactions with unwritten data pages. In addition, it is not needed to do a crash recovery or a rollback operation. The log file is archived to a location specified by the database configuration. When archived successfully, DB2 deletes the log from the database log directory.
Archived
Filled or closed log files that were archived to IBM Storage Protect™ storage.
Figure 1. Log management with DB2 log manager and Data Protection for SAP

This graphic shows the other possibility of managing log files, namely by using the built-in DB2 Log manager. The graphic is divided into two sections. The upper section shows the backup of DB2 log files from the log directory through the DB2 log manager and how these data are passed to the IBM Storage Protect server. The lower section shows the retrieval of log files from IBM Storage Protect by and restoring these files to the log directory by the DB2 log manager. Both the archiving and retrieval are described in detail in the following text.

Data Protection for SAP for DB2 is loaded dynamically by the DB2 log manager as a shared library on UNIX™ or Linux™. It is also loaded as a dynamic link library (DLL) on Windows™, and runs as part of the DB2 engine. When a log file is ready to be archived (online/offline retained), the DB2 log manager starts the archive process by passing the file as blocks to Data Protection for SAP. The data is then sent (by Data Protection for SAP) to IBM Storage Protect storage.

When a database rollforward recovery is issued, the DB2 log manager first checks if the corresponding log files are in either the log path or in an overflow log path. Either log path is specified in the DB2 rollforward command invocation. If the log files are not found at one of these locations, the DB2 log manager accesses Data Protection for SAP to determine whether the log images are available on IBM Storage Protect. If available, Data Protection for SAP retrieves the data from IBM Storage Protect and sends them as blocks to the DB2 log manager. Then, the log manager writes the log files to the file system. The log files are then applied to the database by using DB2 processes.

Detailed information about the DB2 log manager is available in your DB2 Administration Guide.