Backup And Recovery User's Guide-使用資料恢復指導診斷和修復錯誤-修復失敗

LuiseDalian發表於2014-02-13

在同一會話執行了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/,如需轉載,請註明出處,否則將追究法律責任。

相關文章