RMAN Error: ORA-01152: file 1 was not restored from a sufficiently old backup & ORA-01110:
Posted by FatDBA on January 15, 2014
RMAN Scenario:
DB: Oracle 11g r2
OS: Linux – RHEL 5
Error: “ORA-01152: file 1 was not restored from a sufficiently old backup” when tried to open the database.
STATUS
==============
SQL> @db
NAME ROLE LOG_MODE OPEN_MODE DG_BROKE FORC_LGNG CUR_SCN CKPT_CHG CTRLFIL_SEQ CTRLFL_CNG ARCH_CNG PROT_MOD
——— ———- ———— ————– ——– ———– ————– ————— ———– ————— ————– ——————–
SAIRAM PRIMARY ARCHIVELOG MOUNTED DISABLED YES 0 32913920280 795938526 32913922263 32913811789 MAXIMUM PERFORMANCE
SQL> select open_mode from v$database;
OPEN_MODE
————–
MOUNTED
This is what’s happening with the database when tried to open it.
Throwing error which reads System datafile is restored from an old backup.
SQL> alter database open resetlogs;
alter database open resetlogs
*
ERROR at line 1:
ORA-01152: file 1 was not restored from a sufficiently old backup
ORA-01110: data file 1: ‘/dbmount212/sairam/datafiles/system01.dbf’
When tried to recover the database it’s asking for sequence number 75, which is not available (Conformed, as asked sequence is not available in ARCHIVE destination).
SQL> recover database until cancel using backup controlfile;
ORA-00279: change 32913922263 generated at 01/14/2014 10:57:39 needed for thread 1
ORA-00289: suggestion : /dbmount212/oracle/sairam/archivelog/1_75_833707787.arc
ORA-00280: change 32913922263 for thread 1 is in sequence #75
Specify log: {<RET>=suggested | filename | AUTO | CANCEL}
AUTO
ORA-00308: cannot open archived log ‘/dbmount212/oracle/sairam/archivelog/1_75_833707787.arc’
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
ORA-00308: cannot open archived log ‘/dbmount212/oracle/sairam/archivelog/1_75_833707787.arc’
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
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: ‘/dbmount212/sairam/system01.dbf’
There is a possibility that the sequence might be struck inside of any redo log file and has not been archived.
Let’s query required sequence number (75) using one of the dynamic view v$log
SQL> select * from v$log where SEQUENCE#=’75’;
GROUP# THREAD# SEQUENCE# BYTES BLOCKSIZE MEMBERS ARC STATUS FIRST_CHANGE#
———- ———- ———- ———- ———- ———- — —————- ————-
FIRST_TIM NEXT_CHANGE# NEXT_TIME
——— ———— ———
9 1 75 524288000 512 1 NO CURRENT 3.2914E+10
14-JAN-14 2.8147E+14
Yes,the log is inside group number 9. Let’s check the location of the related log file using v$logfile;
SQL> SELECT * FROM V$LOGFILE where group#=’9′;
GROUP# STATUS TYPE
———- ——- ——-
MEMBER
—————————————————————————————————-
IS_
—
9 ONLINE
/var/log/oracle/redo/onlinelog/redo07.log
NO
Let’s try to recover the database again.
SQL> recover database until cancel using backup controlfile;
ORA-00279: change 32913922872 generated at 01/14/2014 11:17:33 needed for thread 1
ORA-00289: suggestion : /dbmount212/oracle/sairam/archivelog/1_75_833707787.arc
ORA-00280: change 32913922872 for thread 1 is in sequence #75Specify log: {<RET>=suggested | filename | AUTO | CANCEL}
/var/log/oracle/redo/onlinelog/redo09.log
ORA-00283: recovery session canceled due to errors
ORA-01111: name for data file 69 is unknown – rename to correct file
ORA-01110: data file 69: ‘/dbmnt12/oracle/product/11.2.0/dbhome_1/dbs/UNNAMED00069’
ORA-01157: cannot identify/lock data file 69 – see DBWR trace file
ORA-01111: name for data file 69 is unknown – rename to correct file
ORA-01110: data file 69: ‘/dbmnt12/oracle/product/11.2.0/dbhome_1/dbs/UNNAMED00069’
Alright, it’s asking for one datafile (69) which is unknown to the controlfile. Yes, this is right. As we have created a test datafile before that controlfile backup.
As it’s of no importance, we’d dropped the datafile.
SQL> alter database datafile 69 offline drop;
Database altered.
Let’s try again to recover the database using the log file ‘/var/log/oracle/redo/onlinelog/redo09.log’.
SQL> recover database using backup controlfile ;
ORA-00279: change 32913922872 generated at 01/14/2014 11:17:33 needed for thread 1
ORA-00289: suggestion : /dbmount212/oracle/sairam/archivelog/1_75_833707787.arc
ORA-00280: change 32913922872 for thread 1 is in sequence #75
Specify log: {<RET>=suggested | filename | AUTO | CANCEL}
/var/log/oracle/redo/onlinelog/redo09.log
Log applied.
Media recovery complete.
Okay, when provided exact filename of the logfile, it has accepted it and applied and came up, hence media recovery is completed.
Now we can go and try to open the database.
SQL> alter database open resetlogs;
Database altered.
SQL> archive log list;
Database log mode Archive Mode
Automatic archival Enabled
Archive destination /dbmount212/oracle/sairam/archivelog/
Oldest online log sequence 1
Next log sequence to archive 1
Current log sequence 1
And we are up!
Below provided is the list of incarnation of the database and the last line with a new incarnation created on today’s date.
SQL> select * from V$DATABASE_INCARNATION;
INCARNATION# RESETLOGS_CHANGE# RESETLOGS PRIOR_RESETLOGS_CHANGE# PRIOR_RES STATUS RESETLOGS_ID PRIOR_INCARNATION# FLASHBACK_DATABASE_ALLOWED
———— —————– ——— ———————– ——— ——- ———— —————— ————————–
1 602821 05-MAY-10 1 12-MAR-08 PARENT 718177612 0 NO
2 148027929 19-MAY-10 602821 05-MAY-10 PARENT 719411741 1 NO
3 9199856900 28-AUG-11 148027929 29-MAY-10 PARENT 760357356 2 NO
4 1.9412E+10 11-AUG-12 9199856900 28-AUG-11 PARENT 791021290 3 NO
5 3.2910E+10 09-DEC-13 1.9412E+10 1-AUG-12 PARENT 833707787 4 NO
6 3.2914E+10 15-JAN-14 3.2910E+10 09-DEC-13 CURRENT 836892925 5 YES
6 rows selected.
Hope That Helps
Prashant Dixit
espèce said
I do agree with all of the concepts you’ve presented in your post.
They are very convincing and can certainly work.
Nonetheless, the posts are too brief for beginners.
Could you please prolong them a bit from next time?
Thanks for the post.
mounesh said
thx a ton prashanth
it helped me resolve recovery issues
Ganeshan S said
Very well appreciated for your post and it helped a lot !
Thanks
Ganeshan S
Avnish said
I am trying to recover on another host and there redo.log file is not present.
The backup was taken with ‘backup incremental database plus archivelog delete input;’ still one archive log file is missing. Oracle release 12.2.0.1.0.