Permission required: DBA or a system administrator running rollforwarddb with the –u flag. On VMS, if using this command against a database in a group level installation, you must have the VMS CMKRNL privilege.
The rollforwarddb command recovers a database or table from the last checkpoint and the current journal and dump files. When executing table level recovery, you can optionally move the table to a new location.
If the target checkpoint was performed online (while the database was in use), then rollforwarddb does the following:
If the target checkpoint was executed offline, then the second step is omitted.
By default, rollfrowarddb sequentially restores data locations one at a time. A database with more than one data location can be restored in parallel.
For detailed procedures on performing backup and recovery of the database, see the Database Administrator Guide.
The rollforwarddb command has the following format:
rollforwarddb dbname[/server_class] [+c|-c] [+j|-j] [#m[n]]
[-mdevice{, device}] [-bdd-mmm-yyyy:hh:mm:ss[.cc]] [-edd-mmm-yyyy:hh:mm:ss[.cc]]
[-norollback] [#c[n]] [+w|-w] [-v] [#f] [-uusername] [-help] [-statistics]
[-table=tablename{, tablename} [-nosecondary_index] [-on_error_continue]
[-relocate –location=locationname {, locationname}
-new_location=locationname{, locationname}]]
[-dmf_cache_size= x] [-dmf_cache_size_4k|8k|16k|32k|64k= x]
Identifies the database (one database name only) to be recovered, and if required, the server_class, as described in Standard Flags and Parameters.
Recovers (+c) or do not recovers (-c) the database from the checkpoint file. The default is +c.
Recovers (+j or do not recovers (-j) the database from the journal. The default is +j.
Recovers the checkpoint from the specified tape device. If a list of tape devices is supplied, parallel recovery will be used for a multi-location database.
If the database was checkpointed to a tape, you can use the –m flag to restore the database from the tape.
VMS: Before executing rollforwarddb from a tape device, the tape must be inserted into the tape drive.
Recovers transactions that were completed after the specified date and time only. Fractional seconds are optional and assumed to be ".00" if not specified.
Recovers transactions that were completed before the specified date and time only. Fractional seconds are optional and assumed to be ".00" if not specified.
Caution! Use the –b and –e options with caution. Using these parameters to skip recovery of a segment of the journal file is not supported. Table level recovery using the –e option will result in the table being logically inconsistent.
Bypasses the rollback phase of rollforward and leaves the database in the exact state described by the journal files. If used with the -e flag, then the database is left in the state described by the journal files up to the time specified. Any incomplete transactions are left incomplete. If transactions are left incomplete, the database will be in an inconsistent state after the rollforwarddb.
Note: Use this parameter only if directed by customer support.
Recovers from an older checkpoint. The checkpoint number n must be a valid checkpoint number (as shown by the infodb command). This flag can be used to recover the database when the current checkpoint is unfinished. If n is omitted, the most recent usable finished checkpoint is used for the recovery.
UNIX: In bash shell, you must place this option in quotes; otherwise characters after the # will be treated as a comment. For example:
rollforwarddb empdata "#c1" 
For a discussion of limitations and cautions when recovering from older checkpoints, see the Database Administrator Guide.
Waits (+w) or does not wait (-w) for the database to be free (not in use). The default is -w.
VMS: The +w|-w flag directs rollforwarddb to wait (+w) or not wait (-w) for the database to be free before recovering the database. Since rollforwarddb requires the database to be locked, this flag allows you to decide whether to wait for the database to be free if it is in use. If you specify +w, rollforwarddb will wait as long as necessary for the database to become free for locking and recovery. If you specify –w, an error is returned if the database is busy. The default is –w.
This flag can be used only in interactive sessions and not in batch mode.
Recovers n locations at a time from disk, for a multi-location database.
Recovers the database from the journal in verbose mode, which provides diagnostic information about all operations executed during the recovery process.
Forces journaling enablement, if rollforwarddb with journaling is attempted on a database that has journaling disabled.
Specifies the effective user for the session, as described in Standard Flags and Parameters.
Displays command syntax online.
Prints statistics about the rollforwarddb operation.
Specifies a list of tables to be recovered from the target checkpoint. If multiple tables are specified, no space is allowed between the tables listed. Table recovery is not allowed for views, system catalogs, or Enterprise Access tables.
If recovering a base table, blob columns (long byte and long varchar columns) will be recovered, and secondary indexes will be recovered, unless –nosecondary_index is specified.
Inhibits automatic recovery of secondary indexes.
Note: All secondary indexes will be marked inconsistent. The base table cannot be accessed until the secondary indexes are rebuilt or dropped.
This option is invalid for database level recovery.
Continues processing, if possible, if an error occurs. If an error occurs processing a table, the table is removed from the table list and processing continues. If rollforwarddb processing has already started for the table when the error occurs, the table is marked inconsistent and all further operations on this table are ignored.
If this option is not specified and an error is encountered, all tables being recovered are marked inconsistent and rollforwarddb terminates.
Note: This option does not force continuation of an invalid rollforwarddb command. The rollforwarddb process is terminated immediately if an invalid table—for example, a view, system catalog, Enterprise Access table, nonexistent table, or a table for which recovery is disallowed—is specified.
This option is invalid for database level recovery.
Indicates that a table is to be relocated to a new location during recovery. When using this option, –location and –new_location must also be specified.
This option is invalid for database level recovery.
Specifies a data location or list of locations (locationname).
When –relocate and –new_location are also specified, the data in each area in the location list is moved to the corresponding area in the new location list. Only tables being recovered are relocated.
This option is invalid for database level recovery.
Specifies a new data location or list of new data locations (locationname).
When relocate and location are also specified, the data in each area in the location list is moved to the corresponding area in the new location list. Only tables being recovered are relocated.
When this option is specified, –relocate and location must also be specified, and the number of locations in the location list must equal the number of locations in the new location list. (The number of location names associated with a table cannot be changed using rollforwarddb.)
This option is invalid for database level recovery.
Specifies the size of the local cache that rollforwarddb allocates, in number of buffers.
Default values are:
-dmf_cache_size=256, which indicates 256 2 KB buffers.
-dmf_cache_size_xk=200, where x is the buffer size indicated in the keyword. For example, dmf_cache_size_64k=200 indicates 200 64 KB buffers.
If you specify 0 for the 4 KB, 8 KB, 16 KB, 32 KB, or 64 KB buffers, 256 buffers are allocated.
Note: Both the journal and the checkpoint must be online before executing the command.
rollforwarddb empdata –v
rollforwarddb empdata –table=emp,emphist
rollforwarddb empdata –table=emp,emphist -nosecondary_index
Note: The indexes on tables emp and emphist will have to be rebuilt or dropped before the tables can be accessed.
rollforwarddb empdata –table=emp,emphist -relocate –location=emploc –new_location=newemploc
UNIX:
rollforwarddb empdata +c +j –m/dev/rmt0
VMS:
rollforwarddb empdata +c +j –mMTA0: