RDB/VMS Relational Database Operator RECOVER — VMS RDB_3.1A
Reconstructs a database by re-entering past transactions from the after-image journal file in a database restored from a backup copy. The backup copy CANNOT be a file created by the RDO EXPORT statement. Use the RMU/BACKUP command to create backup copies of your Rdb/VMS databases. After-image journaling is especially useful for repairing a database after a disk failure. Digital Equipment Corporation recommends that you use the RMU/RECOVER command instead of the RDO RECOVER statement.
Additional information available:
Format
RECOVER ──┬─>
F
I
L
E
N
A
M
E ───> file-spec ───┬───┐ └─>
P
A
T
H
N
A
M
E ───> path-name ───┘ │ │ ┌───────────────────<────────────────────┘ └───>
J
O
U
R
N
A
L ──> aij-journal-file-spec ─┐ │ ┌───────────────────<────────────────────┘ └─┬──────────────────────────────>────────────────┬──┐ └─>
N
U
M
B
E
R typebox (O)F
B
U
F
F
E
R
S typebox (I)typebox (S) ──> number-buffers ────┘ │ ┌───────────────────────────────<────────────────────┘ └┬─────>───────────┬───────┬────────>────────┬───────────> └──>
U
N
T
I
L time ──┘ ├──>
T
R
A
C
E ───────┤ └──>
N
O
T
R
A
C
E ─────┘
Additional information available:
file-specpath-nameaij-journal-file-spectimenumber-buffers
file-spec
The VMS file specification for the database to be recovered. If you use a partial file specification, Rdb/VMS uses it in conjunction with the fully qualified database file specification that is recorded in the specified after-image journal file. It is recommended that you use a fully qualified file specification instead of a partial file specification.
path-name
The path name that refers to the data dictionary entity for the database. You can specify a full or relative path name. When you specify PATHNAME, the fully qualified file specification that is recorded in the data dictionary is passed as the file specification for the database to be recovered.
aij-journal-file-spec
The file specification for the after-image journal file to be used as the source of the transactions that the RECOVER statement re-enters in the database.
time
The time that represents the limit to the recovery operation. Use standard VMS absolute time format: dd-mmm-yyyy hh:mm:ss.cc
number-buffers
The number of database buffers used during the roll-forward process. Specifying a large number of buffers results in a faster recovery time. The default is 20 buffers.
TRACE_NOTRACE
Specifies whether details of the roll-forward process are displayed at your terminal. The default is NOTRACE.
Example
The following example shows how to recover a database using an after-image journal: $ ! $ ! SET DEFAULT DDV21:[TEST] $ ! $ RDO :== $RDO $ RDO RDO> DEFINE DATABASE 'DDV21:[TEST]SAMPLE_DB' cont> DICTIONARY IS NOT USED cont> DICTIONARY IS NOT REQUIRED. RDO> ! RDO> ! Use the FINISH statement to detach from the database, then RDO> ! issue the CHANGE DATABASE statement that automatically invokes RDO> ! the specified database. RDO> ! RDO> FINISH RDO> ! RDO> ! Create after-image journaling. The AIJ file RDO> ! is given the name SAMPLE.AIJ (and is placed on a disk other RDO> ! than the disk holding the RDB and SNP files): RDO> ! RDO> CHANGE DATABASE FILENAME 'DDV21:[TEST]SAMPLE_DB' cont> JOURNAL FILE IS USER$DISK:[CORP]SAMPLE.AIJ. RDO> EXIT $ ! $ ! Using RMU/BACKUP, make a backup copy of the database. $ ! This command ensures that you have a copy of the $ ! database at a known time, in a known state. $ ! $ RMU/BACKUP/LOG DDV21:[TEST]SAMPLE_DB USER2:[BACKUPS]SAMPLE_BACKUP.RBF %RMU-I-BCKTXT_01, Thread 1 uses devices USER2: %RMU-I-BCKTXT_08, Thread 1 was assigned file DDV21:[TEST]SAMPLE_DB.RDB;1 %RMU-I-BCKTXT_00, Backed up root file %RMU-I-BCKTXT_02, Full backup of storage area DDV21:[TEST]SAMPLE_DB.RDB;1 %RMU-I-BCKTXT_02, Full backup of storage area DDV21:[TEST]SAMPLE_DB.RDB;1 %RMU-I-BCKTXT_04, ignored 1 space management page %RMU-I-BCKTXT_05, backed up 3 inventory pages %RMU-I-BCKTXT_06, backed up 114 logical area bitmap pages %RMU-I-BCKTXT_07, backed up 285 data pages $ ! $ ! Now you can use RDO with after-image journaling enabled. $ ! $ RDO RDO> ! RDO> ! Invoke the database and perform some data definition and storage. RDO> ! RDO> INVOKE DATABASE FILENAME 'DDV21:[TEST]SAMPLE_DB' RDO> ! RDO> START_TRANSACTION READ_WRITE RDO> DEFINE FIELD NEW_FIELD DATATYPE TEXT 10. %RDO-W-NOCDDUPDAT, database invoked by filename, the CDD will not be updated RDO> ! RDO> DEFINE RELATION RELATION1. cont> NEW_FIELD. cont> END. RDO> COMMIT RDO> ! RDO> START_TRANSACTION READ_WRITE RDO> STORE R IN RELATION1 USING cont> R.NEW_FIELD = "data" cont> END_STORE RDO> COMMIT RDO> ! RDO> ! Imagine that a disk crash occurred here. In such a situation, RDO> ! the current database is inaccessible. You need a prior copy RDO> ! of the database to roll forward all the transactions in the RDO> ! AIJ file. RDO> ! RDO> FINISH RDO> EXIT $ ! $ ! You know that the backup of the database is $ ! uncorrupted. Use RMU/RESTORE to restore the database. $ ! Because the after-image journal file is enabled, a $ ! new after-image journal file is created as part of this $ ! restore operation. (The new AIJ file is SAMPLE.AIJ;2.) $ RMU/RESTORE/NOCDD_INTEGRATE/NEW_VERSION/LOG/DIR=DDV21:[TEST] - _$ USER2:[BACKUPS]SAMPLE_BACKUP.RBF %RMU-I-RESTXT_04, Thread 1 uses devices USER2: %RMU-I-RESTXT_00, Restored root file DDV21:[TEST]SAMPLE_DB.RDB;2 %RMU-I-LOGRESSST, restored storage area DDV21:[TEST]SAMPLE_DB.RDB;1 %RMU-I-LOGRESSST, restored storage area DDV21:[TEST]SAMPLE_DB.RDB;1 %RMU-I-RESTXT_05, rebuilt 1 space management page %RMU-I-RESTXT_06, restored 3 inventory pages %RMU-I-RESTXT_07, rebuilt 114 logical area bitmap pages %RMU-I-RESTXT_08, restored 285 data pages %RMU-I-RESTXT_01, Initialized snapshot file DDV21:[TEST]SAMPLE_DB.SNP;2 %RMU-I-LOGINIFIL, contains 100 pages, each page is 2 blocks long %RMU-I-LOGCREAIJ, created after-image journal file USER$DISK:[CORP]SAMPLE.AIJ;2 $ ! $ ! LOOP: $ ! $ RDO RDO> ! RDO> ! Use the RECOVER command to roll forward the RDO> ! database changes contained in the AIJ file. RDO> ! The date used in the UNTIL clause in this example RDO> ! represents some time in the future. This causes Rdb/VMS RDO> ! to apply the entire AIJ file. Note that SAMPLE.AIJ;1 is RDO> ! specified because SAMPLE.AIJ;1 contains the transactions RDO> ! that occurred before the RMU/RESTORE command (which created RDO> ! a new version of the AIJ file) was issued. Note that the AIJ RDO> ! file is applied to the version of the database (SAMPLE_DB.RDB;2) RDO> ! created by the RMU/RESTORE command. If the version of the database RDO> ! is not specified in the RECOVER statement, Rdb/VMS attempts to RDO> ! recover the previous version of the database and the recovery RDO> ! attempt fails because of a mismatch between the database file RDO> ! and after-image journal file. RDO> ! RDO> RECOVER FILENAME 'DDV21:[TEST]SAMPLE_DB.RDB;2' cont> JOURNAL USER$DISK:[CORP]SAMPLE.AIJ;1 UNTIL 01-JAN-1999 TRACE %RDMS-I-LOGOPNAIJ, opened journal file USER$DISK:[CORP]SAMPLE.AIJ;1 %RDMS-I-LOGRECDB, recovering database file DDV21:[TEST]SAMPLE_DB.RDB;2 %RDMS-I-LOGRECSTAT, transaction with TSN 8 committed %RDMS-I-LOGRECSTAT, transaction with TSN 9 committed %RDMS-I-LOGRECOVR, 2 transactions committed %RDMS-I-LOGRECOVR, 0 transactions rolled back %RDMS-I-LOGRECOVR, 0 transactions ignored %RDMS-I-AIJSUCCES, database recovery completed successfully RDO> EXIT $ ! $ ! If you want to apply more than one journal file to $ ! the same database, repeat the steps from the $ ! "LOOP:" label.