Recovers a database by applying transactions recorded in the database log files. Invoked after a database or a table space backup has been restored, or if any table spaces have been taken offline by the database due to a media error. The database must be recoverable (that is, either logretain, userexit, or both of these database configuration parameters must be set on) before the database can be recovered with roll-forward recovery.
Scope
In a multi-node environment, this command can only be issued from the catalog node. A database or table space rollforward command specifying a point-in-time affects all nodes that are listed in the db2nodes.cfg file. A database or table space rollforward command specifying end of logs affects the nodes that are specified. If no nodes are specified, it affects all nodes that are listed in the db2nodes.cfg file.
Authorization
One of the following:
Required Connection
None. This command establishes a database connection.
Command Syntax
>>-ROLLFORWARD---+-DATABASE-+database-alias---------------------> +-DB-------+ >--+---------------------------------------+--------------------> +-USER--username--+------------------+--+ +-USING--password--+ >--+------------------------------------------------------------+> +-TO--+-isotime----------------------------+-+--------------++ | +-END OF LOGS--+--------------------++ +-AND COMPLETE-+| | +-| On Node clause |-+ +-AND STOP-----+| +--+-COMPLETE------+-+--------------------+------------------+ +-STOP----------+ +-| On Node clause |-+ +-CANCEL--------+ +-QUERY STATUS--+ >-+----------------------------------------------------------+--> +-TABLESPACE---+-ONLINE----------------------------------+-+ | +-,----------------+ | | V | | +-(----tablespace-name--+--)--+---------+-+ +-ONLINE--+ >--+--------------------------------------------------------------------------+->< +-OVERFLOW LOG PATH--(--log-directory--+-----------------------------+--)--+ +-,--| Log Overflow clause |--+ Log Overflow clause +-,-------------------------------------+ V | |----log-directory--ON NODE--node-number1--+-------------------| On Node clause |--ON--+-| Node List clause |------------------------+---------| +-ALL NODES--+-------------------------------++ +-EXCEPT--| Node List clause |--+ Node List clause +-,----------------------------------+ V | |--+-NODE---+(-----node-number1--+-------------------++-)------| +-NODES--+ +-TO--node-number2--+ |
Command Parameters
This value is specified as a time stamp, a 7-part character string that identifies a combined date and time. The format is yyyy-mm-dd-hh.mm.ss.nnnnnn (year, month, day, hour, minutes, seconds, microseconds), expressed in Coordinated Universal Time (CUT).
The environment variable TZ indicates the difference between CUT and local time. For example, a TZ value of EST5EDT indicates that the local time zone is EST; that there is a 5-hour difference between this time zone and CUT; and that daylight savings time is observed. This observance reduces the difference from 5 to 4 hours when daylight savings time is in effect, and CUT = current time + 4.
Note: | In a multi-node environment, if isotime is specified, roll forward recovery is performed on all nodes. |
Note: | When rolling table spaces forward to a point-in-time, the table spaces are placed in backup pending state. |
Note: | When rolling table spaces forward to a point-in-time, the table spaces are placed in backup pending state. |
Note: | Use this option with caution. |
Note: | QUERY STATUS is the default if the TO, STOP, COMPLETE, and CANCEL clauses are
omitted.
If TO, STOP, or COMPLETE are specified, this information will be displayed if the command ran successfully. |
In a single-node environment, a relative overflow log path can be specified, but in a multi-node environment, the path must be fully qualified.
Usage Notes
The database manager uses the information stored in the archive and active log files to reconstruct the transactions performed on the database since its last backup.
If the database is in roll-forward pending state when ROLLFORWARD DATABASE is invoked, the database will be rolled forward. Table spaces are returned to normal state after a successful database roll-forward, unless an abnormal state causes one or more table spaces to go offline.
If the database is not in roll-forward pending state and no point in time is specified, any table spaces that are in rollforward-in-progress state will be rolled forward to the end of logs. If no table spaces are in rollforward-in-progress state, any table spaces that are in rollforward pending state will be rolled forward to the end of logs.
The roll-forward operation can be performed on a subset of table spaces by specifying table space names.
If rolling forward table spaces to a point in time, a subset of table spaces must be specified. Only those table spaces specified will be rolled forward. Each table space must be in roll-forward pending state or, if continuing a table space roll-forward that is already in progress, in rollforward-in-progress state.
If enabling an existing database for roll-forward recovery, change the number of primary log files to the sum of the number of primary log files and secondary log files +1. More information will be logged for LONG VARCHAR fields and LOB data in a database enabled for roll-forward recovery.
Rolling databases forward may require a load recovery using tape devices. If prompted for another tape, the user can respond with one of the following:
Rolling databases forward may involve prerequisites and restrictions that are beyond the scope of this manual. For more detailed information, see the Administration Guide.
See Also