Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1279670
  • 博文数量: 1211
  • 博客积分: 10010
  • 博客等级: 上将
  • 技术积分: 14340
  • 用 户 组: 普通用户
  • 注册时间: 2008-06-09 11:20
文章分类

全部博文(1211)

文章存档

2011年(1)

2008年(1210)

我的朋友

分类: 服务器与存储

2008-06-13 13:39:23

这一类的操作是因为丢失了所有的控制文件,而RMAN的备份信息又在控制文件之中。
  
  所以只能使用DMBS_BACKUP_RESTORE从备份集中恢复数据文件、归档日志等进行恢复。
  
  本例示范如何恢复归档日志文件,恢复数据文件的例子参考:应对RMAN-06026错误,使用dbms_backup_restore进行恢复
  
  SQL> DECLARE
   2  devtype varchar2(256);
   3  done boolean;
   4  BEGIN
   5  devtype:=sys.dbms_backup_restore.deviceAllocate(type=>'',ident=>'t1');
   6  sys.dbms_backup_restore.restoreSetArchivedLog(destination=>'D:\oracle\oradata\eygle\archive');
   7  sys.dbms_backup_restore.restoreArchivedLog(thread=>1,sequence=>6);
   8  sys.dbms_backup_restore.restoreBackupPiece(done=>done,handle=>'D:\oracle\oradata\eygle\bak\ARCH_EYGLE_20050702_7',params=>null);
   9  sys.dbms_backup_restore.deviceDeallocate;
  10 END;
  11 /
  
  PL/SQL procedure successfully completed.
  
  执行不完全恢复以后,resetlogs打开数据库:
  
  SQL> recover database using backup controlfile until cancel;
  ORA-00279: change 459405 generated at 07/02/2005 23:58:32 needed for thread1
  ORA-00289: suggestion : D:\ORACLE\ORADATA\EYGLE\ARCHIVE\ARC16.ARC
  ORA-00280: change 459405 for thread 1 is in sequence #6
  
  Specify log: {=suggested | filename | AUTO | CANCEL}
  
  ORA-00279: change 459428 generated at 07/02/2005 23:59:32 needed for thread1
  ORA-00289: suggestion : D:\ORACLE\ORADATA\EYGLE\ARCHIVE\ARC17.ARC
  ORA-00280: change 459428 for thread 1 is in sequence #7
  ORA-00278: log file 'D:\ORACLE\ORADATA\EYGLE\ARCHIVE\ARC16.ARC' no longer needed for this recovery
  
  Specify log: {=suggested | filename | AUTO | CANCEL}
  
  ORA-00279: change 459516 generated at 07/03/2005 00:02:40 needed for thread1
  ORA-00289: suggestion : D:\ORACLE\ORADATA\EYGLE\ARCHIVE\ARC18.ARC
  ORA-00280: change 459516 for thread 1 is in sequence #8
  ORA-00278: log file 'D:\ORACLE\ORADATA\EYGLE\ARCHIVE\ARC17.ARC' no longer needed for this recovery
  
  Specify log: {=suggested | filename | AUTO | CANCEL}
  
  ORA-00328: archived log ends at change 456840, need later change 459516
  ORA-00334: archived log: 'D:\ORACLE\ORADATA\EYGLE\ARCHIVE\ARC18.ARC'
  
  SQL> recover database using backup controlfile until cancel;
  ORA-00279: change 459516 generated at 07/03/2005 00:02:40 needed for thread1
  ORA-00289: suggestion : D:\ORACLE\ORADATA\EYGLE\ARCHIVE\ARC18.ARC
  ORA-00280: change 459516 for thread 1 is in sequence #8
  
  Specify log: {=suggested | filename | AUTO | CANCEL}
  cancel
  Media recovery cancelled.
  SQL> alter database open resetlogs;
  
  Database altered.
  
  SQL>
阅读(298) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~