DB2 10.5 for Linux, UNIX, and Windows

Recovering data

The RECOVER DATABASE command recovers a database and all storage groups to a specified time, by using information found in the recovery history file.

Before you begin

If you issue the RECOVER DATABASE command following an incomplete recover operation that ended during the rollforward phase, the recover utility attempts 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 must 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.

About this task

The database can be local or remote.

Note: In a partitioned database environment, the recover utility must be invoked from the catalog partition of the database.

Procedure

To invoke the recover utility, use the:

Example

The following example shows how to use the RECOVER DATABASE command through the CLP:
   db2 recover db sample