backupdatabase;破壞數(shù)據(jù)參看日志《RMAN進行基于數(shù)據(jù)塊的恢復(fù)》使用rman驗證數(shù)據(jù)文件RMAN>backupvalidatedatafile5;Startingbackupat29-AUG-14usingtargetdatab" />

黄色网页视频 I 影音先锋日日狠狠久久 I 秋霞午夜毛片 I 秋霞一二三区 I 国产成人片无码视频 I 国产 精品 自在自线 I av免费观看网站 I 日本精品久久久久中文字幕5 I 91看视频 I 看全色黄大色黄女片18 I 精品不卡一区 I 亚洲最新精品 I 欧美 激情 在线 I 人妻少妇精品久久 I 国产99视频精品免费专区 I 欧美影院 I 欧美精品在欧美一区二区少妇 I av大片网站 I 国产精品黄色片 I 888久久 I 狠狠干最新 I 看看黄色一级片 I 黄色精品久久 I 三级av在线 I 69色综合 I 国产日韩欧美91 I 亚洲精品偷拍 I 激情小说亚洲图片 I 久久国产视频精品 I 国产综合精品一区二区三区 I 色婷婷国产 I 最新成人av在线 I 国产私拍精品 I 日韩成人影音 I 日日夜夜天天综合

RMAN進行基于數(shù)據(jù)塊的恢復(fù)

系統(tǒng) 2028 0

從ORACLE9i開始,rman支持基于數(shù)據(jù)庫的恢復(fù),這一功能有很大的好處,既不影響業(yè)務(wù),甚至不影響有壞塊的數(shù)據(jù)文件,恢復(fù)可以是在線恢復(fù)。但是恢復(fù)是完全恢復(fù),所以要求完整的備份。

下面測試:

  1. 對數(shù)據(jù)庫進行完整備份

    Rman>backup database;

  2. 破壞數(shù)據(jù)

    參看日志《RMAN進行基于數(shù)據(jù)塊的恢復(fù)》

  3. 使用rman驗證數(shù)據(jù)文件

    RMAN> backup validate datafile 5;

    Starting backup at 29-AUG-14

    using target database control file instead of recovery catalog

    allocated channel: ORA_DISK_1

    channel ORA_DISK_1: sid=159 devtype=DISK

    allocated channel: ORA_DISK_2

    channel ORA_DISK_2: sid=139 devtype=DISK

    channel ORA_DISK_1: starting full datafile backupset

    channel ORA_DISK_1: specifying datafile(s) in backupset

    input datafile fno=00005 name=/opt/oracle/oradata/orcla/xzsp.dbf

    channel ORA_DISK_1: backup set complete, elapsed time: 00:00:07

    Finished backup at 29-AUG-14

    警告日志和數(shù)據(jù)庫中都會記錄損壞的數(shù)據(jù),如下

    SQL> select * from v$database_block_corruption ;

    FILE# BLOCK# BLOCKS CORRUPTION_CHANGE# CORRUPTIO

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

    5 49316 1 0 CORRUPT

  4. 通過備份基于數(shù)據(jù)快級的恢復(fù)

    RMAN> blockrecover datafile 5 block 49316 from backupset;

    Starting blockrecover at 29-AUG-14

    using channel ORA_DISK_1

    using channel ORA_DISK_2

    ?

    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 /opt/oracle/flash_recovery_area1/ORCLA/backupset/2014_08_29/o1_mf_nnndf_TAG20140829T032828_9zz0px68_.bkp

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

    piece handle=/opt/oracle/flash_recovery_area1/ORCLA/backupset/2014_08_29/o1_mf_nnndf_TAG20140829T032828_9zz0px68_.bkp tag=TAG20140829T032828

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

    ?

    starting media recovery

    ?

    archive log thread 1 sequence 5 is already on disk as file /opt/oracle/flash_recovery_area1/ORCLA/archivelog/2014_08_29/o1_mf_1_5_9zz2mqwo_.arc

    archive log thread 1 sequence 6 is already on disk as file /opt/oracle/flash_recovery_area1/ORCLA/archivelog/2014_08_29/o1_mf_1_6_9zz2v3jj_.arc

    archive log thread 1 sequence 7 is already on disk as file /opt/oracle/flash_recovery_area1/ORCLA/archivelog/2014_08_29/o1_mf_1_7_9zz3hfff_.arc

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

    Finished blockrecover at 29-AUG-14

  5. 清楚壞塊記錄

    SQL> select * from v$database_block_corruption ;

    FILE# BLOCK# BLOCKS CORRUPTION_CHANGE# CORRUPTIO

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

    5 49316 1 0 CORRUPT

    RMAN> backup validate datafile 5;

    Starting backup at 29-AUG-14

    using channel ORA_DISK_1

    using channel ORA_DISK_2

    channel ORA_DISK_1: starting full datafile backupset

    channel ORA_DISK_1: specifying datafile(s) in backupset

    input datafile fno=00005 name=/opt/oracle/oradata/orcla/xzsp.dbf

    channel ORA_DISK_1: backup set complete, elapsed time: 00:00:03

    Finished backup at 29-AUG-14

    SQL> select * from v$database_block_corruption ;

    ?

    no rows selected

    ?

    注意:

    但有些情況下,BLOCKRECOVER未必可以恢復(fù)得了:

    [oracle@ique datafile]$ sqlplus mayp/mayp

    SQL*Plus: Release 10.1.0.5.0 – Production on Mon Jul 14 17:08:06 2008

    Copyright (c) 1982, 2005, Oracle. All rights reserved.

    Connected to:

    Oracle Database 10g Enterprise Edition Release 10.1.0.5.0 – Production

    With the Partitioning, OLAP and Data Mining options

    SQL> select count(*) from mssm;

    select count(*) from mssm

    *

    ERROR at line 1:

    ORA-01578: ORACLE data block corrupted (file # 5, block # 9)

    ORA-01110: data file 5: '/data/mayp/MAYP/datafile/o1_mf_mssm_4789hznr_.dbf'

    [oracle@ique datafile]$ rman target /

    Recovery Manager: Release 10.1.0.5.0 – Production

    Copyright (c) 1995, 2004, Oracle. All rights reserved.

    connected to target database: MAYP (DBID=412172232)

    RMAN> blockrecover datafile 5 block 9;

    Starting blockrecover at 14-JUL-08

    using target database controlfile instead of recovery catalog

    allocated channel: ORA_DISK_1

    channel ORA_DISK_1: sid=378 devtype=DISK

    RMAN-00571: ===========================================================

    RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============

    RMAN-00571: ===========================================================

    RMAN-03002: failure of blockrecover command at 07/14/2008 17:08:37

    ORA-01455: converting column overflows integer datatype

    RMAN-06010: error while looking up datafile: 5

    這個塊損壞已經(jīng)嚴(yán)重破壞了數(shù)據(jù)的存放規(guī)律,發(fā)生了邏輯損壞,所以blockrecover沒辦法恢復(fù),必須首先restore這個文件然后通過recvoer命令進行恢復(fù).

    通過常規(guī)方法恢復(fù)這個錯誤:

    RMAN> sql 'alter database datafile 5 offline';

    sql statement: alter database datafile 5 offline

    RMAN> restore datafile 5;

    Starting restore at 14-JUL-08

    using channel ORA_DISK_1

    channel ORA_DISK_1: starting datafile backupset restore

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

    restoring datafile 00005 to /data/mayp/MAYP/datafile/o1_mf_mssm_4789hznr_.dbf

    channel ORA_DISK_1: restored backup piece 1

    piece handle=/home/oracle/product/10.2/dbs/full_2_MAYP.rman tag=TAG20080714T152854

    channel ORA_DISK_1: restore complete

    Finished restore at 14-JUL-08

    RMAN> recover datafile 5;

    Starting recover at 14-JUL-08

    using channel ORA_DISK_1

    starting media recovery

    media recovery complete

    Finished recover at 14-JUL-08

    RMAN> sql 'alter database datafile 5 online';

    sql statement: alter database datafile 5 online

    RMAN> exit

    BLOCKRECOVER 的使用限制:

    1、數(shù)據(jù)庫必須在ARCHIVELOG模式下才可以使用這個功能;

    2、數(shù)據(jù)庫必須是mount或open狀態(tài);

    3、不能對一個offline的datafile進行BLOCKRECOVER;

    4、blcokrecover需要通過一個full backups 恢復(fù)datra block,不能使用incremental backups進行錯誤恢復(fù);

    5、blockrecover不能跨越archivelog丟失或損壞,也就是說在恢復(fù)的過程中,不能丟失需要的歸檔日志;

    6、blockrecover不能恢復(fù)邏輯壞塊,邏輯壞塊必須首先restore損壞的數(shù)據(jù)文件,然后在用recover進行恢復(fù);

    7、blockrecvoer不能恢復(fù)file header block.(block=1).

RMAN進行基于數(shù)據(jù)塊的恢復(fù)


更多文章、技術(shù)交流、商務(wù)合作、聯(lián)系博主

微信掃碼或搜索:z360901061

微信掃一掃加我為好友

QQ號聯(lián)系: 360901061

您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描下面二維碼支持博主2元、5元、10元、20元等您想捐的金額吧,狠狠點擊下面給點支持吧,站長非常感激您!手機微信長按不能支付解決辦法:請將微信支付二維碼保存到相冊,切換到微信,然后點擊微信右上角掃一掃功能,選擇支付二維碼完成支付。

【本文對您有幫助就好】

您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描上面二維碼支持博主2元、5元、10元、自定義金額等您想捐的金額吧,站長會非常 感謝您的哦!!!

發(fā)表我的評論
最新評論 總共0條評論