RMAN修復壞塊

a960549548發表於2024-02-29

在查詢某表時,提示出現壞塊。

在有做 RMAN 備份的情況下

壞塊數量多的話,我們可以先把資料庫關掉,起到 mount 狀態,備份下損壞的資料檔案, restore 損壞的資料檔案,然後 recover database 或者 recover datafile 5

 

壞塊數量少的話,可以用 RMAN 直接去修復壞塊。

RMAN> backup validate datafile 5;

SQL> select * from v$database_block_corruption where file#=5;

 

     FILE#     BLOCK#     BLOCKS CORRUPTION_CHANGE# CORRUPTIO

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

         5         34      12767                  0 CORRUPT

 

RMAN> blockrecover datafile 5 block 34 from backupset;

 

Starting recover at 24-AUG-21

using channel ORA_DISK_1

 

 

channel ORA_DISK_1: restoring block(s)

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

restoring blocks of datafile 00005

channel ORA_DISK_1: reading from backup piece /oracle/rman/orcl_full07078p7m_1_1.bak

channel ORA_DISK_1: piece handle=/oracle/rman/orcl_full07078p7m_1_1.bak tag=TAG20210823T203045

channel ORA_DISK_1: restored block(s) from backup piece 1

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

 

starting media recovery

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

 

Finished recover at 24-AUG-21


來自 “ ITPUB部落格 ” ,連結:https://blog.itpub.net/70013625/viewspace-3007713/,如需轉載,請註明出處,否則將追究法律責任。

相關文章