I am testing out the restore of my database. I originally backed it up using this script.

RMAN> run{
2> backup
3> full
4> tag Full_Oracle_Backup
5> filesperset 5
6> format 'c:\database\backup\backup_030127_142529\%d_030127_142529_%s'
7> database plus archivelog;
8> backup
9> filesperset 5
10> format 'c:\database\backup\backup_030127_142529\%d_030127_142529_%s.cf'
11> current controlfile;
12> }

That script works fine.

But when I delete the old database and try to restore it from the backup, I get this error:

Starting recover at 27-JAN-03
using channel ORA_DISK_1

starting media recovery

archive log thread 1 sequence 5 is already on disk as file C:\DATABASE\ARCHIVE\ARC00005.001
archive log filename=C:\DATABASE\ARCHIVE\ARC00005.001 thread=1 sequence=5
unable to find archive log
archive log thread=1 sequence=6
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of recover command at 01/27/2003 15:42:44
RMAN-06054: media recovery requesting unknown log: thread 1 scn 7376392

It is looking for an archive log that does not exist. Why is rman looking for this archive log if it never existed? Shouldn't it stop on the last archive log? Or is there some way to stop it from trying to read a log that isn't there?

The database opens up fine when I specify "alter database open resetlogs;" manually, even after the error. But unfortunately it fails out on the missing log error and never gets to the database open command within the script.

Any help would be appreciated.