# Restoring DB2 Log Files

You can restore archive log filess separately. If all the log files are backed up, then you can restore the archive log files with the database.

By default, the log files are restored to the DB2 retrieve path that is specified while installing the DB2 Agent.

Restoring log files is useful in the following scenarios:

- If the database fails and needs to be recovered to its most recent state, you can restore all the log files along with the database.

- If the log files from a specific time range are lost due to a hard disk corruption, you can restore the log files by performing a point-in-time restore of the log files.

- In certain cases, you might need to restore only specific log files that are missing in the database. You can identify these log files, and then restore them by using the time ranges.

The Commvault software waits for 2 minutes for the IntelliSnap operation to complete. If the job does not finish within this time, the system marks it as failed and takes the database out of the quiesced state. You can increase the wait time to allow more time for the job to complete.

## In-Place Restore

### Procedure

1. From the Command Center navigation pane, go to Protect > Databases.

   The Overview page appears.

2. On the Instances tab, in the row for the database instance to restore, click the Action button , and then click Restore.

   Alternatively, click the instance, and in the Recovery points tiles, select Restore option.

   The Backup content page appears.

3. Select the databases to restore, and then click Restore.

   The Restore options dialog box appears.

4. Select In place option.

   Note

   The In place option is selected by default.

5. Select the Redirect option to direct the restore to other database location.

6. Select the Restore database checkbox.

7. Select the Roll forward checkbox to roll forward the logs as part of the restore operation.

   From the Roll forward to type list, make the following selections:

   - To roll forward to the end of all the logs, click To end of the logs.

   - To roll forward to a point in time, click Point in time, and then enter the point in time.

   - To roll forward to end the backup, click To end of backup.

     If you don't roll forward the logs the target database will be in the rollforward pending state after the restore.

8. Select the Alternate log path checkbox, and enter the log path.

9. Select the Overflow Directory checkbox, and enter the workflow directory path.

10. If you move the Advanced options toggle key to right, proceed as follows:

    1. Select Restore to non-encrypted database checkbox to restore the database to a non-encrypted database.

    2. Select the Restore logs checkbox, and then specify the time period of the logs to restore.

    3. Select the Restore logs from backup image (use LOGTARGET) checkbox to restore logs from backup image.

    4. From the MediaAgent list, select a media agent server name.

11. Click Submit.

## Out-of-place Restore

### Procedure

1. From the Command Center navigation pane, go to Protect > Databases.

   The Overview page appears.

2. On the Instances tab, in the row for the database instance to restore, click the Action button , and then click Restore.

   Alternatively, click the instance, and in the Recovery points tiles, select Restore option.

   The Backup content page appears.

3. Select the databases to restore, and then click Restore.

   The Restore options dialog box appears.

4. Select Out of place option.

5. From the Restore type list, you can select the following options:

   1. Cross Instance Restore

   2. Restore to Disk

6. If you move the Advanced options toggle key to right, proceed as follows:

   1. Select Restore to non-encrypted database checkbox to restore the database to a non-encrypted database.

   2. Select the Restore logs checkbox, and then specify the time period of the logs to restore.

   3. Select the Restore logs from backup image (use LOGTARGET) checkbox to restore logs from backup image.

   4. From the MediaAgent list, select a media agent server name.

7. Click Submit.

×

Loading...