Understanding DB2: Learning Visually with Examples (2nd Edition)

13.9. Database Recovery Using the RECOVER DATABASE Command

DB2 Version 8.2 introduces a very simple new RECOVER DATABASE command that combines the RESTORE and ROLLFORWARD command operations into one step. The RECOVER DATABASE command automatically determines which backup image to use by referring to the information in the Recovery History file. For example:

  • To recover the SAMPLE database from the best available backup image and rollforward to end of logs, use:

    RECOVER DB sample

  • To recover the SAMPLE database to the Point In Time 2004-05-21-13.50.00 (note that the PIT is specified in local time, not UTC time), issue:

    RECOVER DB sample TO 2004-05-21-13.50.00

  • To recover the SAMPLE database to an old PIT that is no longer contained in the current history file, you need to provide a saved history file from this time period:

    RECOVER DB sample TO 1999-12-31-04:00:00 USING HISTORY FILE (/home/user/old1999files/db2rhist.asc)

Категории