Example 1 In the following example, the RMU Recover command requests recovery from the .aij file personnel.aij located on PR$DISK in the SMITH directory. It specifies that recovery should continue until 1:30 P.M. on May 7, 1996. Because the Trace qualifier is specified, the RMU Recover command displays detailed information about the recovery operation to SYS$OUTPUT. $ RMU/RECOVER/UNTIL="07-MAY-1996 13:30"/TRACE PR$DISK:[SMITH]PERSONNEL %RMU-I-LOGRECDB, recovering database file DISK1:[DB.70]MF_PERSONNEL.RDB;1 %RMU-I-LOGRECSTAT, transaction with TSN 0:256 committed %RMU-I-AIJONEDONE, AIJ file sequence 0 roll-forward operations completed %RMU-I-AIJAUTOREC, starting automatic after-image journal recovery %RMU-I-AIJONEDONE, AIJ file sequence 1 roll-forward operations completed %RMU-W-NOTRANAPP, no transactions in this journal were applied %RMU-I-AIJALLDONE, after-image journal roll-forward operations completed %RMU-I-AIJSUCCES, database recovery completed successfully %RMU-I-AIJFNLSEQ, to start another AIJ file recovery, the sequence number needed will be 1 Example 2 The following example shows how to use .aij files to recover a database: SQL> CREATE DATABASE FILENAME DISK1:[SAMPLE]TEST_DB cont> RESERVE 5 JOURNALS; SQL> -- SQL> -- Use the DISCONNECT ALL statement to detach from the database, SQL> -- then issue the ALTER DATABASE statement that automatically SQL> -- invokes the specified database. SQL> -- SQL> DISCONNECT ALL; SQL> -- SQL> -- Create after-image journaling. The .aij files are given the SQL> -- names aij_one.aij and aij_two.aij (and are placed on a disk SQL> -- other than the disk holding the .rdb and .snp files): SQL> -- SQL> ALTER DATABASE FILENAME DISK1:[SAMPLE]TEST_DB cont> JOURNAL IS ENABLED cont> ADD JOURNAL AIJ_ONE cont> FILENAME 'USER$DISK:[CORP]AIJ_ONE' cont> BACKUP FILENAME 'USER$DISK2:[CORP]AIJ_ONE' cont> ADD JOURNAL AIJ_TWO cont> FILENAME 'USER$DISK3:[CORP]AIJ_TWO' cont> BACKUP FILENAME 'USER$DISK4:[CORP]AIJ_TWO'; SQL> EXIT $ ! $ ! Using the RMU Backup command, 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 DISK1:[SAMPLE]TEST_DB USER2:[BACKUPS]TEST_BACKUP.RBF $ ! $ ! Now you can use SQL with after-image journaling enabled. $ ! $ SQL SQL> -- SQL> -- Attach to the database and perform some data definition SQL> -- and storage. SQL> -- SQL> ATTACH 'FILENAME DISK1:[SAMPLE]TEST_DB'; SQL> CREATE TABLE TABLE1 (NEW_COLUMN CHAR(10)); SQL> INSERT INTO TABLE1 (NEW_COLUMN) VALUES ('data'); SQL> COMMIT; SQL> EXIT $ ! $ ! Imagine that a disk failure occurred here. In such a situation, $ ! the current database is inaccessible. You need a prior copy $ ! of the database to roll forward all the transactions in the $ ! .aij file. $ ! $ ! $ ! You know that the backup file of the database is $ ! uncorrupted. Use the RMU Restore command to restore and recover $ ! the database. You do not have to issue the RMU Recover command $ ! because the RMU Restore command will automatically recover the $ ! database. $ ! $ RMU/RESTORE/NOCDD_INTEGRATE/DIR=DDV21:[TEST] - _$ USER2:[BACKUPS]TEST_BACKUP.RBF %RMU-I-AIJRSTAVL, 2 after-image journals available for use %RMU-I-AIJRSTMOD, 1 after-image journal marked as "modified" %RMU-I-AIJISON, after-image journaling has been enabled %RMU-W-DOFULLBCK, full database backup should be done to ensure future recovery %RMU-I-LOGRECDB, recovering database file DDV21:[TEST]TEST_DB.RDB;1 %RMU-I-AIJAUTOREC, starting automatic after-image journal recovery %RMU-I-AIJONEDONE, AIJ file sequence 0 roll-forward operations completed %RMU-I-AIJONEDONE, AIJ file sequence 1 roll-forward operations completed %RMU-W-NOTRANAPP, no transactions in this journal were applied %RMU-I-AIJALLDONE, after-image journal roll-forward operations completed %RMU-I-AIJSUCCES, database recovery completed successfully %RMU-I-AIJFNLSEQ, to start another AIJ file recovery, the sequence number needed will be 1 Example 3 The following example demonstrates how the recovery operation works when there are .aij backup files to be applied. First you must restore the database by using the RMU Restore command with the Norecovery qualifier, then apply the backed up .aij file by using the RMU Recover command. Oracle RMU will complete the recovery with the .aij files that were current when the restore operation was invoked. This example assumes that three .aij files have been added to the mf_personnel database prior to the first shown backup operation and that journaling is enabled. $ ! Create a backup file of the complete and full database. $ ! $ RMU/BACKUP MF_PERSONNEL DISK1:[BACKUPS]MF_PERSONNEL_BCK.RBF $ ! $ ! Updates are made to the SALARY_HISTORY and DEPARTMENTS tables. $ ! $ SQL SQL> ATTACH 'FILENAME MF_PERSONNEL'; SQL> UPDATE SALARY_HISTORY cont> SET SALARY_END='20-JUL-1993 00:00:00.00' cont> WHERE SALARY_START='14-JAN-1983 00:00:00' cont> AND EMPLOYEE_ID='00164'; SQL> INSERT INTO DEPARTMENTS cont> (DEPARTMENT_CODE, DEPARTMENT_NAME, cont> MANAGER_ID,BUDGET_PROJECTED, BUDGET_ACTUAL) cont> VALUES ('WLNS', 'WELLNESS CENTER', '00188',0,0); SQL> COMMIT; SQL> DISCONNECT DEFAULT; SQL> EXIT $ ! $ ! Create a backup file of the .aij files. $ ! $ RMU/BACKUP/AFTER_JOURNAL MF_PERSONNEL DISK2:[BACKUP]MF_PERS_AIJBCK $ ! $ ! An additional update is made to the DEPARTMENTS table. $ ! $ SQL SQL> ATTACH 'FILENAME MF_PERSONNEL'; SQL> INSERT INTO DEPARTMENTS cont> (DEPARTMENT_CODE, DEPARTMENT_NAME, MANAGER_ID,BUDGET_PROJECTED, cont> BUDGET_ACTUAL) cont> VALUES ('facl', 'FACILITIES', '00190',0,0); SQL> COMMIT; SQL> DISCONNECT DEFAULT; SQL> EXIT; $ $ ! Assume the disk holding the SALARY_HISTORY and DEPARTMENTS $ ! storage areas is lost. Restore only those areas. Specify $ ! the Norecovery qualifier since you will need to apply the $ ! .aij backup file. $ $ RMU/RESTORE/AREA DISK1:[BACKUPS]MF_PERSONNEL_BCK.RBF - _$ SALARY_HISTORY, DEPARTMENTS/NORECOVER $ ! $ ! Now recover the database. Although you only specify the .aij $ ! backup file, Oracle RMU will automatically continue the $ ! recovery with the current journals in the recovery sequence after $ ! the backed up .aij files have been applied. $ ! $ RMU/RECOVER/LOG DISK2:[BACKUP]MF_PERS_AIJBCK %RMU-I-AIJBADAREA, inconsistent storage area DISK3:[STO_AREA] DEPARTMENTS.RDA;1 needs AIJ sequence number 0 %RMU-I-AIJBADAREA, inconsistent storage area DISK3:[STO_AREA]SALARY_HISTORY.RDA;1 needs AIJ sequence number 0 %RMU-I-LOGRECDB, recovering database file DISK3:[DATABASE]MF_PERSONNEL.RDB;1 %RMU-I-LOGOPNAIJ, opened journal file DISK2:[BACKUP]MF_PERS_AIJBCK.AIJ;1 %RMU-I-AIJONEDONE, AIJ file sequence 0 roll-forward operations completed %RMU-I-LOGRECOVR, 3 transactions committed %RMU-I-LOGRECOVR, 0 transactions rolled back %RMU-I-LOGRECOVR, 0 transactions ignored %RMU-I-AIJNOACTIVE, there are no active transactions %RMU-I-AIJSUCCES, database recovery completed successfully %RMU-I-AIJNXTSEQ, to continue this AIJ file recovery, the sequence number needed will be 1 %RMU-I-AIJAUTOREC, starting automatic after-image journal recovery %RMU-I-LOGOPNAIJ, opened journal file DISK4:[CORP]AIJ_TWO.AIJ;1 %RMU-I-AIJONEDONE, AIJ file sequence 1 roll-forward operations completed %RMU-I-LOGRECOVR, 2 transactions committed %RMU-I-LOGRECOVR, 0 transactions rolled back %RMU-I-LOGRECOVR, 0 transactions ignored %RMU-I-AIJNOACTIVE, there are no active transactions %RMU-I-AIJSUCCES, database recovery completed successfully %RMU-I-AIJNXTSEQ, to continue this AIJ file recovery, the sequence number needed will be 2 %RMU-I-AIJALLDONE, after-image journal roll-forward operations completed %RMU-I-LOGSUMMARY, total 5 transactions committed %RMU-I-LOGSUMMARY, total 0 transactions rolled back %RMU-I-LOGSUMMARY, total 0 transactions ignored %RMU-I-AIJSUCCES, database recovery completed successfully %RMU-I-AIJGOODAREA, storage area DISK3:[STO_AREA]DEPARTMENTS.RDA;1 is now consistent %RMU-I-AIJGOODAREA, storage area DISK3:[STO_AREA]SALARY_HISTORY.RDA;1 is now consistent %RMU-I-AIJFNLSEQ, to start another AIJ file recovery, the sequence number needed will be 2 $ ! $ ! Database is restored and recovered and ready to use. $ ! Example 4 The following example demonstrates how to recover all the known inconsistent pages in a database. Assume the RMU Show Corrupt_ Pages command reveals that page 60 in the EMPIDS_LOW storage area is inconsistent and pages 11 and 123 in the EMPIDS_MID storage area is inconsistent. The RMU Recover command is issued to recover on line all pages logged inconsistent in the corrupt page table (CPT). After the recovery operation, the CPT will be empty. $ RMU/RECOVER/JUST_CORRUPT/ONLINE/LOG MF_PERSONNEL.AIJ %RMU-I-AIJBADPAGE, inconsistent page 11 from storage area DISK1:[TEST5]EMPIDS_OVER.RDA;1 needs AIJ sequence number 0 %RMU-I-AIJBADPAGE, inconsistent page 60 from storage area DISK1:[TEST5]EMPIDS_LOW.RDA;1 needs AIJ sequence number 0 %RMU-I-AIJBADPAGE, inconsistent page 123 from storage area DISK1:[TEST5]EMPIDS_OVER.RDA;1 needs AIJ sequence number 0 %RMU-I-LOGRECDB, recovering database file DISK2:[TEST5]MF_PERSONNEL.RDB;1 %RMU-I-LOGOPNAIJ, opened journal file DISK3:[TEST5]MF_PERSONNEL.AIJ;1 %RMU-I-AIJONEDONE, AIJ file sequence 0 roll-forward operations completed %RMU-I-LOGRECOVR, 1 transaction committed %RMU-I-LOGRECOVR, 0 transactions rolled back %RMU-I-LOGRECOVR, 0 transactions ignored %RMU-I-AIJNOACTIVE, there are no active transactions %RMU-I-AIJSUCCES, database recovery completed successfully %RMU-I-AIJALLDONE, after-image journal roll-forward operations completed %RMU-I-LOGSUMMARY, total 1 transaction committed %RMU-I-LOGSUMMARY, total 0 transactions rolled back %RMU-I-LOGSUMMARY, total 0 transactions ignored %RMU-I-AIJSUCCES, database recovery completed successfully %RMU-I-AIJGOODPAGE, page 11 from storage area DISK1:[TEST5]EMPIDS_OVER.RDA;1 is now consistent %RMU-I-AIJGOODPAGE, page 60 from storage area DISK1:[TEST5]EMPIDS_LOW.RDA;1 is now consistent %RMU-I-AIJGOODPAGE, page 123 from storage area DISK1:[TEST5]EMPIDS_OVER.RDA;1 is now consistent %RMU-I-AIJFNLSEQ, to start another AIJ file recovery, the sequence number needed will be 0 Example 5 In the following example, note that the backed up AIJ files are specified in the order B1, B3, B2, B4 representing sequence numbers 1, 3, 2, 4. The /ORDER_AIJ_FILES sorts the journals to be applied into ascending sequence order and then is able to remove B1 from processing because the database recovery starts with AIJ file sequence 2 as shown in the RMU/RESTORE output. $ RMU/RESTORE/NEW/NOCDD/NOAFTER FOO %RMU-I-RESTXT_00, Restored root file DUA0:[DB]FOO.RDB;16 . . . %RMU-I-AIJRECFUL, Recovery of the entire database starts with AIJ file sequence 2 %RMU-I-COMPLETED, RESTORE operation completed at 24-MAY-2007 12:23:32.99 $! $ RMU/RECOVER/LOG/ORDER_AIJ_FILES B1,B3,B2,B4 . . . %RMU-I-LOGOPNAIJ, opened journal file DUA0:[DB]B2.AIJ;24 %RMU-I-LOGRECSTAT, transaction with TSN 0:256 ignored %RMU-I-LOGRECSTAT, transaction with TSN 0:257 ignored %RMU-I-RESTART, restarted recovery after ignoring 2 committed transactions %RMU-I-AIJONEDONE, AIJ file sequence 2 roll-forward operations completed %RMU-I-LOGRECOVR, 0 transactions committed %RMU-I-LOGRECOVR, 0 transactions rolled back %RMU-I-LOGRECOVR, 2 transactions ignored %RMU-I-AIJNOACTIVE, there are no active transactions %RMU-I-AIJSUCCES, database recovery completed successfully %RMU-I-AIJNXTSEQ, to continue this AIJ file recovery, the sequence number needed will be 3 . . . Example 6 The following example shows the "/CONFIRM=ABORT" syntax used so that RMU/RECOVER will not continue rolling forward if a sequence gap is detected. This is the default behavior if /NOCONFIRM is specified or for batch jobs. Note that the exit status of RMU will be "%RMU-E-AIJRECESQ" if the recovery is aborted due to a sequence gap. It is always a good policy to check the exit status of RMU, especially when executing RMU in batch jobs. RMU/RECOVER/CONFIRM=ABORT/LOG/ROOT=user$test:foo faijbck1,faijbck2,faijbck4 %RMU-I-LOGRECDB, recovering database file DEVICE:[DIRECTORY]FOO.RDB;1 %RMU-I-LOGOPNAIJ, opened journal file DEVICE:[DIRECTORY]FAIJBCK4.AIJ;1 at 25-FEB-2009 17:27:42.29 %RMU-W-AIJSEQAFT, incorrect AIJ file sequence 8 when 7 was expected %RMU-E-AIJRECESQ, AIJ roll-forward operations terminated due to sequence error %RMU-I-AIJALLDONE, after-image journal roll-forward operations completed %RMU-I-LOGSUMMARY, total 2 transactions committed %RMU-I-LOGSUMMARY, total 0 transactions rolled back %RMU-I-LOGSUMMARY, total 0 transactions ignored %RMU-I-AIJFNLSEQ, to start another AIJ file recovery, the sequence number needed will be 7 %RMU-I-AIJNOENABLED, after-image journaling has not yet been enabled Example 7 The following example shows the "/CONFIRM=CONTINUE" syntax used so that RMU/RECOVER will continue rolling forward if a sequence gap is detected. RMU/RECOVER/CONFIRM=CONTINUE/LOG/ROOT=user$test:foo faijbck1,faijbck2,faijbck4 %RMU-I-LOGRECDB, recovering database file DEVICE:[DIRECTORY]FOO.RDB;1 %RMU-I-LOGOPNAIJ, opened journal file DEVICE:[DIRECTORY]FAIJBCK4.AIJ;1 at 25-FEB-2009 17:26:04.00 %RMU-W-AIJSEQAFT, incorrect AIJ file sequence 8 when 7 was expected %RMU-I-AIJONEDONE, AIJ file sequence 8 roll-forward operations completed %RMU-I-LOGRECOVR, 1 transaction committed %RMU-I-LOGRECOVR, 0 transactions rolled back %RMU-I-LOGRECOVR, 0 transactions ignored %RMU-I-AIJNOACTIVE, there are no active transactions %RMU-I-AIJSUCCES, database recovery completed successfully %RMU-I-AIJNXTSEQ, to continue this AIJ file recovery, the sequence number needed will be 9 %RMU-I-AIJALLDONE, after-image journal roll-forward operations completed %RMU-I-LOGSUMMARY, total 3 transactions committed %RMU-I-LOGSUMMARY, total 0 transactions rolled back %RMU-I-LOGSUMMARY, total 0 transactions ignored %RMU-I-AIJSUCCES, database recovery completed successfully %RMU-I-AIJFNLSEQ, to start another AIJ file recovery, the sequence number needed will be 9 %RMU-I-AIJNOENABLED, after-image journaling has not yet been enabled