从控制文件自动备份恢复控制文件时,所有的rman信息丢失,导致数据库无法恢复
1 这个是我的脚本
CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 7 DAYS;
CONFIGURE BACKUP OPTIMIZATION ON;
CONFIGURE CONTROLFILE AUTOBACKUP ON;
CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT 'E:\oracle\rmanbakset\df_%U';
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO 'E:\oracle\rmanbakset\%F';
CONFIGURE DEVICE TYPE DISK PARALLELISM 3;
run{
sql'alter database backup controlfile to trace';
backup database filesperset = 2 include current controlfile;
sql'alter system archive log current';
backup archivelog all delete all input format 'E:\oracle\rmanbakset\ac_%U';
crosscheck backup;
delete noprompt expired backup;
}
exit
2 关闭数据库,删除控制文件,数据文件,模拟错误
3 恢复控制文件,从自动备份
RMAN> startup nomount
RMAN> set dbid 841229051
executing command: SET DBID
RMAN> restore controlfile from autobackup;
replicating controlfile
input filename=E:\ORACLE\ORADATA\PRO\CONTROL01.CTL
output filename=E:\ORACLE\ORADATA\PRO\CONTROL02.CTL
output filename=E:\ORACLE\ORADATA\PRO\CONTROL03.CTL
Finished restore at 24-FEB-09
4 alter database mount
RMAN> alter database mount
2> ;
RMAN-00571: =====================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS =========
RMAN-00571: =====================================================
RMAN-03002: failure of alter db command at 02/24/2009 06:46:16
ORA-01991: invalid password file 'E:\oracle\DATABASE\PWDpro.ORA'
5 重建控制文件
C:\Documents and Settings\Administrator>orapwd file=E:\oracle\database\PWDpro.or
a password=abc123
6 RMAN> alter database open;
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of alter db command at 02/24/2009 06:48:49
ORA-01589: must use RESETLOGS or NORESETLOGS option for database open
7 RMAN> restore database;
Starting restore at 24-FEB-09
using channel ORA_DISK_1
RMAN-00571: ===================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS =======
RMAN-00571: ===================================================
RMAN-03002: failure of restore command at 02/24/2009 06:51:06
RMAN-06026: some targets not found - aborting restore
RMAN-06023: no backup or copy of datafile 13 found to restore
RMAN-06023: no backup or copy of datafile 12 found to restore
RMAN-06023: no backup or copy of datafile 11 found to restore
RMAN-06023: no backup or copy of datafile 10 found to restore
RMAN-06023: no backup or copy of datafile 9 found to restore
RMAN-06023: no backup or copy of datafile 8 found to restore
RMAN-06023: no backup or copy of datafile 7 found to restore
RMAN-06023: no backup or copy of datafile 6 found to restore
RMAN-06023: no backup or copy of datafile 5 found to restore
RMAN-06023: no backup or copy of datafile 4 found to restore
RMAN-06023: no backup or copy of datafile 3 found to restore
RMAN-06023: no backup or copy of datafile 2 found to restore
RMAN-06023: no backup or copy of datafile 1 found to restore>
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of alter db command at 02/24/2009 06:49:32
ORA-01152: file 1 was not restored from a sufficiently old backup
ORA-01110: data file 1: 'E:\ORACLE\ORADATA\PRO\SYSTEM01.DBF'
8