8i "until change is before resetlogs" error

From: Ganesh <ganesh.tambat_at_gmail.com>
Date: Tue, 13 Oct 2009 06:02:02 -0700 (PDT)
Message-ID: <48c75b97-b69c-4564-9e51-2201c8c9c22f_at_z4g2000prh.googlegroups.com>



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 Received on Tue Oct 13 2009 - 08:02:02 CDT

Original text of this message