To restore a set of incremental backup images using automatic
incremental restore, issue the RESTORE DATABASE command
specifying time stamp of the last image you want to restore with the TAKEN
AT parameter, as follows: db2 restore db sample incremental automatic taken at timestamp
This
results in the restore utility performing each of the steps described
at the beginning of this section automatically. During the initial
phase of processing, the backup image with the specified time stamp
(specified in the form yyyymmddhhmmss) is read,
and the restore utility verifies that the database, its history, and
the table space definitions exist and are valid.
During the
second phase of processing, the database history is queried to build
a chain of backup images required to perform the requested restore
operation. If, for some reason this is not possible, and DB2 for Linux, UNIX, and Windows is
unable to build a complete chain of required images, the restore operation
terminates, and an error message is returned. In this case, an automatic
incremental restore is not possible, and you must issue the RESTORE
DATABASE command with the INCREMENTAL ABORT parameter.
This will clean up any remaining resources so that you can proceed
with a manual incremental restore.
Note: It is highly recommended
that you not use the WITH FORCE OPTION of the PRUNE
HISTORY command. The default operation of this command prevents
you from deleting history entries that might be required for recovery
from the most recent, full database backup image, but with the WITH
FORCE OPTION, it is possible to delete entries that are
required for an automatic restore operation.
During
the third phase of processing, DB2 for Linux, UNIX, and Windows restores
each of the remaining backup images in the generated chain. If an
error occurs during this phase, you must issue the RESTORE
DATABASE command with the INCREMENTAL ABORT option
to clean up any remaining resources. You must then determine whether
the error can be resolved before you reissue the RESTORE
DATABASE command or attempt the manual incremental restore
again.