From:Steve Adams
Date:19-Oct-2000 19:43
Subject:   Recover through gap in archivelog file set?

I'm sorry, but you cannot recover to any point in time after the gap. I would export what you can from the good tablespaces. Get a copy of BMC LogMaster (or whatever it is called now) to dump out the available redo since the gap. Recover the database to just before the gap. Attempt to run the SQL extracted from the log files against the recovered database. Drop and import the exported tables. Then do a painstaking check to find the extent of the damage.

Because of various backup problems that would take days to explain, we have need to recover a database that is missing one day's worth of archive log files. This 7.3.4.5.0 database on Solaris 2.6 had all of its tablespaces put into hot backup mode at once 7 days ago and for various reasons, were never taken out of backup mode. Last night, we had a crash during the nightly hot backup and lost two filesystems. We have restored the two filesystems, /s009 and /s008, one from last night's backup and one from the night before's backup. That brought us to a state of having a mounted database with all of its datafiles in backup mode. We did alter database datafile 'name' end backup on all of the datafiles, except the ones in /s008 and /s009 (see below). For the ones in the restored filesystems, we received an Oracle error saying that the files are old versions:

SVRMGR> select name from v$datafile a, v$backup b
     2> where a.file# = b.file#
     3> and b.status='ACTIVE';
NAME
--------------------------------------------------------------------------------
/s008/oradata/PROD/fin.dbf
/s008/oradata/PROD/mfgx.dbf
/s008/oradata/PROD/mfgx02.dbf
/s008/oradata/PROD/mfgx03.dbf
/s008/oradata/PROD/fin02.dbf
/s008/oradata/PROD/mfgx04.dbf
/s008/oradata/PROD/mfgx05.dbf
/s009/oradata/PROD/rbs_mnstr_f04.dbf

8 rows selected. SVRMGR> alter database datafile '/s009/oradata/PROD/rbs_mnstr_f04.dbf' end backup; alter database datafile '/s009/oradata/PROD/rbs_mnstr_f04.dbf' end backup * ORA-01235: END BACKUP failed for 1 file(s) and succeeded for 0 ORA-01122: database file 56 failed verification check ORA-01110: data file 56: '/s009/oradata/PROD/rbs_mnstr_f04.dbf' ORA-01208: data file is an old version - not accessing current version SVRMGR>

When we try to do recover datafile on this datafile (rbs_mnstr_f04.dbf), Oracle says it needs an archive log file from 7 days ago, which was the day that all of the datafiles were put into backup mode and never taken out of it. The problem with this is that 5 days ago, due to human error, we lost (accidentally deleted) a day's worth of archive log files. Since Oracle is asking for archive log files from before the "gap", we are trying to find out how to convince Oracle that it doesn't need those archive log files since we have all of the datafiles from a point in time after the gap and also all of the archive log files after the gap. I have tried creating a controlfile and also doing recover database using backup controlfile and various other forms of recover database/recover datafile and Oracle always asks for arch logs from before the gap - the day that they were put into hot backup mode. The only thing I've had success with is simulating this scenario on a test database in which I did recover database using backup controlfile until cancel, which I canceled immediately when asked for archlogs from before the gap. I then was able to shut down the database, set _allow_resetlogs_corruption=true in init.ora, and then startup and open with resetlogs. I am assuming, however, that I now have logical corruption, since none of my archlogs from after the gap were applied to the datafiles I just opened with that command.