Oracle RMAN完全恢複案例(七)利用增量備份進行恢複

來源:互聯網
上載者:User

案例7:

--利用增量備份進行恢複

1)建立增量備份

-------利用image 備份作為增量備份的0 級備份

RMAN> copy datafile 2 to '/disk1/rman/prod/users_%s.bak';

2)建立2 級差異備份

--------測試環境

08:05:52 SQL> conn scott/tiger

Connected.

08:05:58 SQL>

08:05:58 SQL> insert into emp1 select * from emp1;

4 rows created.

08:06:00 SQL> /

8 rows created.

08:06:01 SQL> commit;

Commit complete.

08:06:03 SQL>

RMAN> backup incremental level 2 format '/disk1/rman/prod/users_2_%s.bak' datafile 2;

RMAN> list backup of datafile 2;

List of Backup Sets

===================

BS Key  Type LV Size       Device Type Elapsed Time Completion Time

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

37      Incr 2  528.00K    DISK        00:00:00     18-AUG-11

BP Key: 37   Status: AVAILABLE  Compressed: NO  Tag: TAG20110818T080650

Piece Name: /disk1/rman/prod/users_2_42.bak

List of Datafiles in backup set 37

File LV Type Ckp SCN    Ckp Time  Name

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

2    2  Incr 1404665    18-AUG-11 /u01/app/oracle/oradata/prod/users01.dbf

3)建立 2級差異備份

08:06:03 SQL> insert into emp1 select * from emp1;

16 rows created.

08:07:49 SQL> /

32 rows created.

08:07:51 SQL> commit;

Commit complete.

08:07:53 SQL>

RMAN> backup incremental level 2 format '/disk1/rman/prod/users_2_%s.bak' datafile 2;

4)建立累計增量備份

08:07:53 SQL> insert into emp1 select * from emp1;

64 rows created.

08:08:55 SQL> /

128 rows created.

08:08:55 SQL> commit;

Commit complete.

08:08:57 SQL>

RMAN> backup incremental level 1 cumulative  format '/disk1/rman/prod/users_1cu_%s.bak' datafile 2;

BS Key  Type LV Size       Device Type Elapsed Time Completion Time

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

41      Incr 1  528.00K    DISK        00:00:00     18-AUG-11

BP Key: 41   Status: AVAILABLE  Compressed: NO  Tag: TAG20110818T080942

Piece Name: /disk1/rman/prod/users_1cu_46.bak

List of Datafiles in backup set 41

File LV Type Ckp SCN    Ckp Time  Name

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

2    1  Incr 1404815    18-AUG-11 /u01/app/oracle/oradata/prod/users01.dbf

--------------恢複

1)測試環境

08:08:57 SQL> select count(*) from emp1;

COUNT(*)

----------

256

08:10:33 SQL> shutdown abort

[oracle@work ~]$ rm /u01/app/oracle/oradata/prod/users01.dbf

2)啟動資料庫

08:10:52 SQL> startup

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.