Re: 8i "until change is before resetlogs" error

From: Mark D Powell <Mark.Powell2_at_hp.com>
Date: Tue, 13 Oct 2009 07:41:56 -0700 (PDT)
Message-ID: <a02ab910-f0a2-4410-8c3b-28186c9124be_at_g31g2000yqc.googlegroups.com>



On Oct 13, 9:02 am, Ganesh <ganesh.tam..._at_gmail.com> wrote:
> I have been struggling with my 8i DB recovery for some time now. My
> problem is the "until change is before resetlogs" error. I am using 8i
> (8.1.7) on windows 2k SP4 with no recovery catalog.
>
> Please see below my readings:
>
> After first ( control file + DB + Archivelog ) backup (script
> mentioned below):
> next_change#: 282584
> resetlogs_change#: 282236
>
> After restoring only control file:
> next_change#: 282584
> resetlogs_change#: 282236
>
> After database restore and recovery (using below mentioned script):
> next_change#: 282584
> resetlogs_change#: 282236
>
> After opening DB with "alter database open resetlogs"
> next_change#: 282584
> resetlogs_change#: 282585
>
> Till now everything works correctly and the DB can be resored and
> opened. But after this restore, problems start if I backup the DB
> again. Since now the control file contains next_change# which is less
> than resetlogs_change# the second backup's control file contains this
> info. And when I try to restore from this second backup I start to get
> the "Until change is before resetlogs change" error.
>
> Please see below the script I am using to backup the DB:
>
> RUN {
>  ALLOCATE CHANNEL ch0 TYPE 'SBT_TAPE';
>  BACKUP INCREMENTAL LEVEL=0 DATABASE;
>  BACKUP ARCHIVELOG ALL;
>  sql "ALTER SYSTEM ARCHIVE LOG CURRENT";
>  BACKUP ARCHIVELOG FROM TIME "TO_DATE('10/13/2009 15:51:36', 'MM/DD/
> YYYY HH24:MI:SS')";
>  BACKUP CURRENT CONTROLFILE;
>
>  RELEASE CHANNEL ch0;
>  }
>
> Please see below script I am using for restoring the DB after control
> file restore:
>
> RUN {
>  ALLOCATE CHANNEL ch0 TYPE 'SBT_TAPE';
>  RESTORE DATABASE UNTIL SCN 282584;
>  RECOVER DATABASE UNTIL SCN 282584;
>  RELEASE CHANNEL ch0;
>  alter database open resetlogs;
>  }
>
> The SCN number I am fetching using follwoing query:
>
> SQL> select max(next_change#) from V$archived_log;
>
> MAX(NEXT_CHANGE#)
> -----------------
>            282631
>
> (I need to use "UNTIL SCN" in the RMAN script because if I use only
> "restore database" and "recover database" the recovery fails with
> unknown log sequence error. I have gone through related docs and it
> looks to me some issues with 8i RMAN)
>
> One solution I could find for this problem is to do sql "ALTER SYSTEM
> ARCHIVE LOG CURRENT"; after every restore. This will make sure that
> the next_change# is always greater than resetlogs_change# after any
> restore. And further backups and restore can work correctly. But I am
> not sure whether this can cause any issues.
>
> If anyone can advise me on this then that would be very helpful.
>
> Thanks in advance.
> Ganesh Tambat

How did you restore the control file? Did you restore a copy that is before the SCN that you want to stop your recovery using?

>> From Backup Oracle8i Recovery Manager User's Guide and Reference Release 2 (8.1.6) Part Number A76990-01 >>
If for some reason you need to restore a control file created before a certain date, issue a set until command for that date. Otherwise, go to the next step.

Allocate one or more channels.
Restore the control file.
Mount the database.

run {

     # To restore a control file created before a certain date, issue the following

     # set command using a valid date for 'date_string'. You can also specify an SCN

     # or log sequence number.
     # set until time = 'date_string';
     allocate channel ch1 type 'sbt_tape';
     restore controlfile;
     alter database mount;

}
<<

Now if you have alreadys performed a recovery and are trying again you may have to follow the instructions for "Recovering a Pre-RESETLOGS Backup" which can also be found in the same chapter.

HTH -- Mark D Powell -- Received on Tue Oct 13 2009 - 09:41:56 CDT

Original text of this message