Reapplying the DB2 Logs (Roll-Forward)

Updated

You can reapply the logs when you have log files that contain transactions that are not part of the backup that you want to restore. You can reapply logs after you restore a database or table from a backup image.

Note

Roll-forward option is not required with recover database option.

Before you roll-forward the logs on the restored database, ensure that LOGARCHMETH1 parameter, VENDOROPT parameter, and LOGARCHOPT1 parameter are configured as per the software requirements. For information about the requirements, see Setting the DB2 Configuration Parameters.

You can reapply the logs to:

  • the end of the logs - this option applies all of the logs.

  • a specified time - this options applies the logs to the time that you specify

  • the end of the backup - this option rollforwards all the partitions in the data to the earliest time during the rollforward operation that the database was consistent

Whenever the log files are restored with the roll-forward capability, DB2 searches for the following target restore paths when log files are restored with the roll-forward option:

  • DB2's own directory path for log file restores

  • The retrieve path that was specified during the installation of the DB2 Agent

  • The archive path that was specified during the installation of the DB2 Agent

  • The overflow path identified (if any) in the Overflow Directory field within the Roll-Forward.

If it is unable to find any of these paths, the appropriate error is reported in a file within the DB2 Audit Error Path that was specified during installation of the DB2 Agent.

Procedure

  1. From the CommCell Browser, go Client Computers > client > DB2 >instance.

  2. Right-click the backup_set, and then point to All Tasks > Browse and Restore.

  3. From the Browse window, select the tables to restore, and then click Recover All Selected.

    The Restore Options dialog box appears.

  4. On the Recover Database tab, clear the Recover DB check box.

  5. Click Advanced.

    The Advanced Restore Options dialog box appears.

  6. On the Roll-Forward tab, do the following:

    1. Select the Roll-forward (Reapply the Logs) check box.

    2. Select the rollforward options that you want to use.

Option

Steps

To the End of the logs

  1. Select To the End of the logs.

  2. If the client is in a different time zone from the CommServe computer, select the destination time zone from the Time Zone list.

To a Point in Time

  1. Select To a Point in Time.

  2. Select the date and time to reapply the logs to.

  3. If the client is in a different time zone from the CommServe computer, select the destination time zone from the Time Zone list.

To End of Backup

Select To End of Backup.

  1. To leave the database in a pending state until all the logs are applied, select the Leave in Roll-forward Pending State check box.

  2. To restore the logs that are in the overflow directory, in the Overflow Directory box, enter the name of the directory.

    If you enter only the overflow directory path, the Commvault software restores all the logs to this location and does not set the OVERFLOWLOGPATH parameter in the database that you restored.

  3. To reapply and restore the logs to an alternate log path, select the Alternate Log Path check box, and then enter the name of the directory in the box.

    If you enter only the alternate log path, the Commvault software restores all the logs to this location and the location becomes the NEWLOGPATH in the destination DB2 database.

    Note

    If you set both the overflow directory and the alternate log path, the Commvault software restores the logs to the overflow directory and sets the alternate log path as the NEWLOGPATH parameter in the destination DB2 database.

  4. Click OK.

  5. Click OK.