DB2 Version 9.7 for Linux, UNIX, and Windows

Recovering data

Use the RECOVER DATABASE command to recover a database to a specified time, using information found in the recovery history file.

About this task

The database can be local or remote.

You can invoke the recover utility through the command line processor (CLP) or the db2Recover application programming interface (API).

The following example shows how to use the RECOVER DATABASE command through the CLP:
   db2 recover db sample
Note: In a partitioned database environment, the recover utility must be invoked from the catalog partition of the database.

Before you begin

If you issue the RECOVER DATABASE command following an incomplete recover operation that ended during the rollforward phase, the recover utility will attempt to continue the previous recover operation, without redoing the restore phase. If you want to force the recover utility to redo the restore phase, issue the RECOVER DATABASE command with the RESTART option to force the recover utility to ignore any prior recover operation that failed to complete. If you are using the application programming interface (API), specify the caller action DB2RECOVER_RESTART for the iRecoverAction field to force the recover utility to redo the restore phase.

If the RECOVER DATABASE command is interrupted during the restore phase, it cannot be continued. You need to reissue the RECOVER DATABASE command.

You should not be connected to the database that is to be recovered: the recover database utility automatically establishes a connection to the specified database, and this connection is terminated at the completion of the recover operation.