User Guide > User Guide > A. Command Reference > rollforwarddb Command--Recover a Database
Was this helpful?
rollforwarddb Command--Recover a Database
Permission required: DBA or a system administrator running rollforwarddb with the –u flag.
The rollforwarddb command recovers a database from the last checkpoint and the current journal and dump files.
If the target checkpoint was performed online (while the database was in use), then rollforwarddb does the following:
1. Restores the database from the checkpoint location to the database location
2. Restores the database to its state when the checkpoint began
3. Applies the journal records to the database
If the target checkpoint was executed offline, then the second step is omitted.
By default, rollforwarddb sequentially restores data locations one at a time. A database with more than one data location can be restored in parallel.
This command has the following format:
rollforwarddb dbname [+c|-c] [#c[n]] [+j|-j] [-mdevice{, device}]
[-uusername] [#m[n]] [-v] [+w|-w] [‑edd‑mmm‑yyyy[:hh:mm:ss]] [#f] [-statistics]
[‑dmf_cache_size=] [‑dmf_cache_size_4k=] [‑dmf_cache_size_8k=]
[‑dmf_cache_size_16k=] [‑dmf_cache_size_32k=] [‑dmf_cache_size_64k=]
[-help]
dbname
Identifies the database (one database name only) to be recovered.
+c|-c
Recovers (+c) or does not recover (-c) the database from the checkpoint file. The default is +c.
#c[n]
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.
Linux: In bash shell, place this option in quotes; otherwise characters after the # are treated as a comment. For example:
rollforwarddb empdata "#c1"
+j|-j
Recovers (+j) or does not recover (-j) the database from the journal. The default is +j.
Note:  rollforwarddb -j leaves the database in a state that does not correspond to the existing state of the journals, and at the end of the rollforwarddb, journaling will be disabled for the database. To re-enable journaling for the database you must use ckpdb +j.
-mdevice {, device}
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.
-uusername
Specifies the effective user for the session, as described in Standard Flags and Parameters.
#m[n]
Recovers n locations at a time from disk, for a multi-location database.
Linux: In bash shell, place this option in quotes; otherwise characters after the # are treated as a comment.
-v
Recovers the database from the journal in verbose mode, which provides diagnostic information about all operations executed during the recovery process.
+w|-w
Waits (+w) or does not wait (-w) for the database to be free (not in use). The default is -w.
This flag can be used only in interactive sessions and not in batch mode.
-edd-mmm-yyyy[:hh:mm:ss[.cc]]
Recovers transactions that were completed before the specified date and time only. Fractional seconds are optional and assumed to be ".00" if not specified.
#f
Allows rollforwarddb with journaling on a database that has journaling disabled. This flag must be used to roll forward a JOURNAL_DISABLED database.
Note:  If you are not restoring from the most recent checkpoint, and journals are not valid from the checkpoint specified, the roll forward may not be able to redo all updates.
Note:  This flag does not force journaling on. The database state will still show:
JOURNAL_DISABLED
The Database has been Checkpointed.
The Database is not Journaled.
Linux: In bash shell, place this option in quotes; otherwise characters after the # are treated as a comment.
-statistics
Prints statistics about the rollforwarddb operation.
[‑dmf_cache_size= x] [‑dmf_cache_size_4k|8k|16k|32k|64k= x]
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 4k, 8k, 16k, 32k, or 64k buffers, 256 buffers are allocated.
The default values are acceptable for Vector.
-help
Displays command syntax online.
Last modified date: 11/09/2022