时间:2021-07-01 10:21:17 帮助过:31人阅读
之前做了基于SCN的不完全恢复,在尝试恢复的过程中使用了_allow_resetlogs_corruption参数,resetlogs之后,Oracle使用的当前控制
背景:
之前做了基于SCN的不完全恢复,,在尝试恢复的过程中使用了_allow_resetlogs_corruption参数,resetlogs之后,Oracle使用的当前控制文件不允许从这个历史的备份集中进行恢复,从而导致了RMAN-06026这个错误,错误现象如下:
错误现象:
RMAN> restore database;
Starting restore at 26-JUL-12
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=47 devtype=DISK
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of restore command at 07/26/2012 12:41:17
RMAN-06026: some targets not found - aborting 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
错误分析:
首先我们的数据库是肯定做过全备的,但是从如上恢复反馈出来的信息可以看到没有数据文件的备份活拷贝,那么这个时候我们可以考虑尝试的使用
dbms_backup_resetore 这个包来制定路径进行数据库的手工恢复,详细步骤如下:
解决办法:
执行dbms_backup_restore包来进行恢复:
DECLARE
devtype varchar2(256);
done boolean;
BEGIN
devtype:=sys.dbms_backup_restore.deviceAllocate (type=>'',ident=>'FUN');
sys.dbms_backup_restore.restoreSetDatafile;
sys.dbms_backup_restore.restoreDatafileTo(dfnumber=>01,toname=>'/DBBak2/oradata/WWL/system01.dbf');
sys.dbms_backup_restore.restoreDatafileTo(dfnumber=>02,toname=>'/DBBak2/oradata/WWL/undotbs01.dbf');
sys.dbms_backup_restore.restoreDatafileTo(dfnumber=>03,toname=>'/DBBak2/oradata/WWL/sysaux01.dbf');
sys.dbms_backup_restore.restoreDatafileTo(dfnumber=>04,toname=>'/DBBak2/oradata/WWL/users01.dbf');
sys.dbms_backup_restore.restoreDatafileTo(dfnumber=>05,toname=>'/DBBak2/oradata/WWL/wwl001.dbf');
sys.dbms_backup_restore.restoreDatafileTo(dfnumber=>06,toname=>'/DBBak2/oradata/WWL/wwl002.dbf');
sys.dbms_backup_restore.restoreDatafileTo(dfnumber=>07,toname=>'/DBBak2/oradata/WWL/wwl003.dbf');
sys.dbms_backup_restore.restoreBackupPiece(done=>done,handle=>'/DBSoft/product/10.2.0/db_1/dbs/0pnh23kk_1_1', params=>null);
sys.dbms_backup_restore.deviceDeallocate;
END;
/