8i "until change is before resetlogs" error

6 views
Skip to first unread message

Ganesh

unread,
Oct 13, 2009, 9:03:22 AM10/13/09
to ORACLE_DBA_EXPERTS
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





sreekanth allampati

unread,
Oct 14, 2009, 1:21:54 AM10/14/09
to oracle_db...@googlegroups.com
Hi ,


Keep in mind that when ever u  open DB with resetlogs option further you have to make the
latest backup immediatly because the OLD backup which is before the recovery (with Resetlogs)
is not useful for further becuase mismatch will happen in SCN

Regards,
Sreekanth
Reply all
Reply to author
Forward
0 new messages