Home » RDBMS Server » Backup & Recovery » 8i "until change is before resetlogs" error
8i "until change is before resetlogs" error [message #425971] Tue, 13 October 2009 07:58 Go to next message
ganeshtambat123
Messages: 3
Registered: October 2009
Junior Member
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





icon6.gif  Re: 8i "until change is before resetlogs" error [message #433350 is a reply to message #425971] Tue, 01 December 2009 14:17 Go to previous message
LKBrwn_DBA
Messages: 487
Registered: July 2003
Location: WPB, FL
Senior Member
Try restoring the controlfile first:
STARTUP NOMOUNT;
RUN {
  ALLOCATE CHANNEL ch0 TYPE 'SBT_TAPE';
  SET UNTIL SCN 282584; 
  RESTORE CONTROLFILE FROM FILE "{the backup file}"; 
  RELEASE CHANNEL ch0;
}
ALTER DATABASE MOUNT;
RUN {
  ALLOCATE CHANNEL ch0 TYPE 'SBT_TAPE';
  SET UNTIL SCN 282584; 
  RESTORE DATABASE; 
  RECOVER DATABASE; 
  RELEASE CHANNEL ch0;
alter database open resetlogs;
}

Shocked
PS: Verify for correct syntax!
Previous Topic: Setting MAXCORRUPT Parameter.
Next Topic: Hot backups without archive logs
Goto Forum:
  


Current Time: Sun Dec 22 17:08:13 CST 2024