How to fix RMAN-20207: UNTIL TIME is before RESETLOGS time
524043Dec 14 2006 — edited Dec 15 2006Early this morning, in my haste to get a point in time restore and recovery started, I forgot to restore the controlfile as the 1st step.
I used the current database control file, and now I have "RMAN-06004: ORACLE error from recovery catalog database: RMAN-20207: UNTIL TIME is before RESETLOGS time". I have a recovery catalog database. This is Oracle 8.1.7.4.
Here was my script syntax:
export ORACLE_SID=myname
export ORACLE_HOME=/x01/oracle/product/8.1.7
export LOG=/x01/admin/recover/point_in_time_${ORACLE_SID}_${TimeStamp}.log
echo "Starting Time: `date`" > $LOG
/x01/oracle/product/8.1.7/bin/rman <<! | tee -a ${LOG}
set echo on;
connect target
connect catalog myuser/mypass@mycatalog
startup nomount pfile='/x01/admin/myname/pfile/initmyname.ora';
alter database mount;
run {
set until time "to_date('2006-12-02:03:00:00','yyyy-mm-dd:hh24:mi:ss')";
allocate channel t1 type 'SBT_TAPE' parms 'ENV=(TDPO_OPTFILE=/usr/tivoli/tsm/client/oracle/bin/tdpo.opt)';
allocate channel t2 type 'SBT_TAPE' parms 'ENV=(TDPO_OPTFILE=/usr/tivoli/tsm/client/oracle/bin/tdpo.opt)';
restore database;
recover database;
release channel t1;
release channel t2;
Alter Database Open Resetlogs;
sql "alter tablespace temp01 add tempfile ''/x01/myname/temp1/temp01_01.tmp'' SIZE 5308416 REUSE AUTOEXTEND ON NEXT 5242880 MAXSIZE 2097217536";
sql "alter tablespace temp01 add tempfile ''/x01/myname/temp1/temp01_02.tmp'' SIZE 5308416 REUSE AUTOEXTEND ON NEXT 5242880 MAXSIZE 2097217536";
}
exit
!
echo "Finished Time: `date`" >> ${LOG}
Can I do the following to try to restore the controlfile? First, I would shutdown my database.
export ORACLE_SID=myname
export ORACLE_HOME=/x01/oracle/product/8.1.7
export LOG=/x01/admin/rman/recover/db_point_in_time_8i_${ORACLE_SID}_${TimeStamp}.log
echo "Starting Time: `date`" > $LOG
/x01/oracle/product/8.1.7/bin/rman <<! | tee -a ${LOG}
set echo on;
connect target
connect catalog myuser/mypass@mycatalog
startup nomount pfile='/x01/admin/myname/pfile/initmyname.ora';
alter database mount;
run {
set until time "to_date('2006-12-02:03:00:00','yyyy-mm-dd:hh24:mi:ss')";
allocate channel t1 type 'SBT_TAPE' parms 'ENV=(TDPO_OPTFILE=/usr/tivoli/tsm/client/oracle/bin/tdpo.opt)';
allocate channel t2 type 'SBT_TAPE' parms 'ENV=(TDPO_OPTFILE=/usr/tivoli/tsm/client/oracle/bin/tdpo.opt)';
restore controlfile to '/x01/disk/control01.ctl';
replicate controlfile from '/x01/disk/control01.ctl';
recover database;
release channel t1;
release channel t2;
Alter Database Open Resetlogs;
sql "alter tablespace temp01 add tempfile ''/x01/myname/temp1/temp01_01.tmp'' SIZE 5308416 REUSE AUTOEXTEND ON NEXT 5242880 MAXSIZE 2097217536";
sql "alter tablespace temp01 add tempfile ''/x01/myname/temp1/temp01_02.tmp'' SIZE 5308416 REUSE AUTOEXTEND ON NEXT 5242880 MAXSIZE 2097217536";
}
exit
!
echo "Finished Time: `date`" >> ${LOG}
I have a new incarnation of the database too -
List of Database Incarnations
DB Key Inc Key DB Name DB ID CUR Reset SCN Reset Time
------- ------- -------- ---------------- --- ---------- ----------
1 2 MYNAME 1849293826 NO 1 06-AUG-03
1 25874 MYNAME 1849293826 NO 750748990 26-SEP-03
1 143681 MYNAME 1849293826 NO 6610874669464 12-AUG-05
1 265345 MYNAME 1849293826 YES 6611455777113 14-DEC-06
What is the fastest way to fix this situation without having to restore the entire database?
Thanks,
Message was edited by:
user521040