ITPub博客

首页 > 数据库 > Oracle > Backup And Recovery User's Guide-使用数据恢复指导诊断和修复错误-修复失败

Backup And Recovery User's Guide-使用数据恢复指导诊断和修复错误-修复失败

原创 Oracle 作者: luisedalian 时间:2014-02-13 21:10:13 0 删除 编辑

在同一会话运行了LIST FAILUREADVISE FAILURE命令之后,可以执行REPAIR FAILURE来执行一个修复选项。

如果执行REPAIR FAILURE,没有任何选项,则会使用当前会话中最后近执行的ADVISE FAILURE命令产生的第一个修复选项。

可以明确指定使用的修复选项号。

--1. 修复上个练习中产生的失败

RMAN> repair failure;

 

Strategy: The repair includes complete media recovery with no data loss

Repair script: /u01/app/oracle/diag/rdbms/testdb12/TestDB12/hm/reco_3484385522.hm

 

contents of repair script:

   # restore and recover datafile

   sql 'alter database datafile 4 offline';

   restore datafile 4;

   recover datafile 4;

   sql 'alter database datafile 4 online';

 

Do you really want to execute the above repair (enter YES or NO)? y

executing repair script

 

sql statement: alter database datafile 4 offline

 

Starting restore at 12-JUL-13

using channel ORA_DISK_1

 

channel ORA_DISK_1: starting datafile backup set restore

channel ORA_DISK_1: specifying datafile(s) to restore from backup set

channel ORA_DISK_1: restoring datafile 00004 to /u01/app/oracle/oradata/TestDB12/users01.dbf

channel ORA_DISK_1: reading from backup piece /u01/app/oracle/fast_recovery_area/TESTDB12/backupset/2013_07_12/o1_mf_nnndf_TAG20130712T032327_8xzcqj9p_.bkp

channel ORA_DISK_1: piece handle=/u01/app/oracle/fast_recovery_area/TESTDB12/backupset/2013_07_12/o1_mf_nnndf_TAG20130712T032327_8xzcqj9p_.bkp tag=TAG20130712T032327

channel ORA_DISK_1: restored backup piece 1

channel ORA_DISK_1: restore complete, elapsed time: 00:00:01

Finished restore at 12-JUL-13

 

Starting recover at 12-JUL-13

using channel ORA_DISK_1

 

starting media recovery

media recovery complete, elapsed time: 00:00:00

 

Finished recover at 12-JUL-13

 

sql statement: alter database datafile 4 online

repair failure complete

 

# 再次访问dept表,恢复正常的访问

scott@TESTDB12>select * from dept;

 

    DEPTNO DNAME          LOC

---------- -------------- -------------

        10 ACCOUNTING     NEW YORK

        20 RESEARCH       DALLAS

        30 SALES          CHICAGO

        40 OPERATIONS     BOSTON

 

# 再次查看失败,刚刚修复的失败已经不存在了

RMAN> list failure;

 

no failures found that match specification     

默认REPAIR FAILURE在执行之前要进行确认。

在执行了修复之后,数据恢复指导会重新评估所有已经存在的失败已经被修复的可能性。

数据恢复指导会验证仍然存在的失败,自动关闭修复的失败。

如果修复因为错误而没有完成,则错误会触发一个新的评估,重新评估存在的错误和修复。

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/17013648/viewspace-1081096/,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2012-02-06

  • 博文量
    1986
  • 访问量
    5642436