Oracle Database - Enterprise Edition - version 11.2.0.4.0
SYMPTOMS
Open resetlogs has an error with ORA-01152: file 1 was not restored from a sufficiently old backup
RMAN>alter database open resetlogs; RMAN-00571: =========================================================== RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS =============== RMAN-00571: =========================================================== RMAN-03002: failure ofalter db command at03/05/201314:34:37 ORA-01152: file 1 was not restored from a sufficiently old backup ORA-01110: data file 1: '/oracle/u01/app/oracle/oradata/orcl/system01.dbf'
CAUSE
This is because the SCN recorded in the controlfile is inconsistent with that in the datafile. The SCN of the restored controlfile is smaller than that recorded in the datafile.
Using archive log or redo log to recover database.
Using built-in parameter _allow_resetlogs_corruption to skip the consistency check, but an ORA-00600[2662] error may occur.
~]$ oerr ora 1152 01152, 00000, "file %s was not restored from a sufficiently old backup " // *Cause: An incomplete recovery session was started, but an insufficient // number of logs were applied to make the database consistent. This // file is still in the future of the last log applied. The most // likely cause of this error is forgetting to restore the file // from a backup before doing incomplete recovery. // *Action: Either apply more logs until the database is consistent or // restore the database file from an older backup and repeat recovery.
Query the SCN:
SQL> col name for a50 SQL>select name,checkpoint_change# from v$datafile;
released channel: ch00 RMAN-00571: =========================================================== RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS =============== RMAN-00571: =========================================================== RMAN-03002: failure of restore command at04/15/202615:05:02 RMAN-06026: some targets not found - aborting restore RMAN-06025: no backup of archived log for thread 1with sequence 14and starting SCN of1260687 found to restore RMAN-06025: no backup of archived log for thread 1with sequence 13and starting SCN of1239019 found to restore RMAN-06025: no backup of archived log for thread 1with sequence 12and starting SCN of1218908 found to restore RMAN-06025: no backup of archived log for thread 1with sequence 11and starting SCN of1196654 found to restore RMAN-06025: no backup of archived log for thread 1with sequence 10and starting SCN of1164995 found to restore RMAN-06025: no backup of archived log for thread 1with sequence 9and starting SCN of1115335 found to restore RMAN-06025: no backup of archived log for thread 1with sequence 8and starting SCN of1089088 found to restore RMAN-06025: no backup of archived log for thread 1with sequence 7and starting SCN of1053728 found to restore RMAN-06025: no backup of archived log for thread 1with sequence 6and starting SCN of1026897 found to restore RMAN-06025: no backup of archived log for thread 1with sequence 5and starting SCN of996525 found to restore RMAN-06025: no backup of archived log for thread 1with sequence 4and starting SCN of976473 found to restore RMAN-06025: no backup of archived log for thread 1with sequence 3and starting SCN of954329 found to restore RMAN-06025: no backup of archived log for thread 1with sequence 2and starting SCN of925918 found to restore
RMAN> recover database;
Starting recover at15-APR-26 using channel ORA_DISK_1
Specify log: {=suggested | filename | AUTO | CANCEL} /oracle/u01/app/oracle/oradata/orcl/redo01.log -- Specify the log file. Log applied. Media recovery complete.
SQL>alter database open resetlogs; Database altered.
Solution 2: Using built-in parameter _allow_resetlogs_corruption to skip the consistency check
RMAN>alter database open resetlogs; RMAN-00571: =========================================================== RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS =============== RMAN-00571: ========================================================== RMAN-03002: failure ofalter db command at03/05/201314:56:41 ORA-01152: file 1 was not restored from a sufficiently old backup ORA-01110: data file 1: '/oracle/u01/app/oracle/oradata/orcl/system01.dbf'
SQL> startup force ORA-32004: obsolete and/or deprecated parameter(s) specified ORACLE instance started. Total SystemGlobal Area 1224736768 bytes Fixed Size 2020384 bytes Variable Size 352324576 bytes Database Buffers 855638016 bytes Redo Buffers 14753792 bytes Database mounted. ORA-01589: must use RESETLOGS or NORESETLOGS option for database open
SQL>altersystemset "_allow_resetlogs_corruption"=truescope=spfile; System altered.
SQL> recover database using backup controlfile until cancel ORA-00279: change 5638424 generated at03/05/201314:48:17 needed for thread 1 ORA-00289: suggestion : /oracle/u01/app/oracle/oradata/orcl/archive/1_1_809275697.dbf ORA-00280: change 5638424for thread 1isin sequence #1 Specify log: {=suggested | filename | AUTO | CANCEL} cancel --Cancel
ORA-01547: warning: RECOVER succeeded but OPEN RESETLOGS would get error below ORA-01152: file 1 was not restored from a sufficiently old backup ORA-01110: data file 1: '/oracle/u01/app/oracle/oradata/orcl/system01.dbf' ORA-01112: media recovery not started
SQL>alter database open resetlogs; alter database open resetlogs * ERROR at line 1: ORA-01092: ORACLE instance terminated. Disconnection forced