日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁(yè) > 编程资源 > 编程问答 >内容正文

编程问答

RMAN 备份与恢复深入解析(二)

發(fā)布時(shí)間:2025/5/22 编程问答 18 豆豆
生活随笔 收集整理的這篇文章主要介紹了 RMAN 备份与恢复深入解析(二) 小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

2.用示例說(shuō)明兩種增量備份的差別

大家早上好,早上的陽(yáng)光真是明媚,新的一天即將開始,下面我們來(lái)研究研究增量備份的奧妙:)

Incremental增量備份:中心思想就是減少備份的數(shù)據(jù)量,我們不需要在從頭開始備份了,只需要備份自上次已備份之后的數(shù)據(jù)塊即可。

關(guān)于Incremental增量備份級(jí)別:

Oracle?9i??共有五種級(jí)別?0?1?2?3?40級(jí)最高-4級(jí)最低,0級(jí)是1級(jí)的基礎(chǔ)以此類推。

Oracle?10g官方文檔明確指出增量備份只有01兩種級(jí)別(太多增量級(jí)別其實(shí)沒有太大的意義),不過(guò)實(shí)際執(zhí)行增量操作時(shí),仍然能夠指定多個(gè)級(jí)別,最大能夠支持4級(jí)增量備份。

Oracle?11g?增量備份只有01兩種級(jí)別。

Level?0級(jí)就是對(duì)數(shù)據(jù)庫(kù)一個(gè)全庫(kù)備份,增量備份必須從0級(jí)開始,也就是說(shuō)必須要有一個(gè)全庫(kù)備份當(dāng)基礎(chǔ)。

如果你是用“backup?full?database”命令做全庫(kù)備份oracle也不認(rèn)為這是level?0的全庫(kù)備份,盡管是一樣的也要單獨(dú)做一次level?0。有了level?0當(dāng)基礎(chǔ)才能有后面的level?1?level?2?level?3?level?4。如果你一上來(lái)比較沖動(dòng)直接發(fā)出level?1備份,oracle會(huì)自動(dòng)在level1前面加一個(gè)level?0,順序是先進(jìn)行l(wèi)evel?0備份再做level?1備份,一共做兩次備份。

關(guān)于Incremental增量備份類型:

(1)差異增量備份:備份上級(jí)及同級(jí)備份以來(lái)所有變化的數(shù)據(jù)塊,差異增量是默認(rèn)增量備份方式

特點(diǎn):觸發(fā)條件小于等于當(dāng)前級(jí)別<=N?????備份時(shí)間快,恢復(fù)時(shí)間慢

?

(2)累積增量備份:備份上級(jí)備份以來(lái)所有變化的塊。

特點(diǎn):小于當(dāng)前級(jí)別<N???????備份時(shí)間慢,恢復(fù)時(shí)間快????C:代表累積

我們系統(tǒng)的備份策略(周策略),僅供參考,如有雷同心心相印,歐巴~阿加西
日期???????????????差異增量??????????累積增量
星期天?????????????????0??????????????????????0
星期一?????????????????2??????????????????????2
星期二?????????????????2??????????????????????2
星期三?????????????????1??????????????????????1
星期四?????????????????2??????????????????????2
星期五?????????????????2??????????????????????2
星期六?????????????????2??????????????????????2
星期日?????????????????0??????????????????????0

下面我們實(shí)驗(yàn)差異增量備份與累積增量備份~備份時(shí)間與恢復(fù)窗口優(yōu)略性

差異增量備份

零級(jí)備份

backupincremental?level?0?database;

創(chuàng)建表空間test1

創(chuàng)建表test1

一級(jí)差異備份

backupincremental?level?1?database;

創(chuàng)建表空間test2

創(chuàng)建表test2

一級(jí)差異備份

backupincremental?level?1?database;

記住當(dāng)前的scn號(hào)(10000),我們刪除表test1和表test2,然后恢復(fù)到scn=10000那一刻,檢查表test1和表test2是否完整恢復(fù)回來(lái),恢復(fù)窗口:恢復(fù)三個(gè)備份集?0+1+1+redo

begin?go

0級(jí)全庫(kù)備份

RMAN>?backup?incremental?level?0?database;

Starting?backup?at?10-MAY-13

using?channel?ORA_DISK_1

channel?ORA_DISK_1:?starting?incremental?level?0?datafile?backup?set??數(shù)據(jù)文件列表

channel?ORA_DISK_1:?specifying?datafile(s)?in?backup?set

input?datafile?file?number=00001name=/u02/app/oracle/oradata/LEO1/system01.dbf

input?datafile?file?number=00002name=/u02/app/oracle/oradata/LEO1/sysaux01.dbf

input?datafile?file?number=00003name=/u02/app/oracle/oradata/LEO1/undotbs01.dbf

input?datafile?file?number=00005name=/u02/app/oracle/oradata/LEO1/leo1.dbf

input?datafile?file?number=00004name=/u02/app/oracle/oradata/LEO1/users01.dbf

channel?ORA_DISK_1:?starting?piece?1?at?10-MAY-13

channel?ORA_DISK_1:?finished?piece?1?at?10-MAY-13

piece?handle=?/u02/app/oracle/backup/DB_0lo99q5p_1_1?tag=TAG20130510T150112?comment=NONE

channel?ORA_DISK_1:?backup?set?complete,?elapsed?time:?00:01:25

Finished?backup?at?10-MAY-13

控制文件自動(dòng)備份

Starting?Control?File?and?SPFILE?Autobackup?at?10-MAY-13

piece?handle=?/u02/app/oracle/backup/control/cf_c-1692458681-20130510-00?comment=NONE

Finished?Control?File?and?SPFILE?Autobackup?at?10-MAY-13

操作系統(tǒng)側(cè)面檢查,順利備份沒有問題?good

[oracle@leonarding1?backup]$?ll

total?983928

drwxr-xr-x?2?oracle?oinstall??????4096?May?10?15:02?control

-rw-r-----?1?oracle?asmadmin?1007534080?May?10?15:02?DB_0lo99q5p_1_1

[oracle@leonarding1?control]$?ll

total?9632

-rw-r-----?1?oracle?asmadmin?9863168?May?10?15:02cf_c-1692458681-20130510-00

創(chuàng)建test1表空間

SYS@LEO1>create?tablespace?test1?datafile'/u02/app/oracle/oradata/LEO1/test1_01.dbf'?size?20m?autoextend?off;

Tablespace?created.

創(chuàng)建test1表

SYS@LEO1>conn?leo1/leo1

Connected.

LEO1@LEO1>create?table?test1?tablespace?test1?as?select?*?fromdba_objects;

Table?created.

LEO1@LEO1>select?checkpoint_change#?from?v$database;???????每做完一個(gè)動(dòng)作我們都記錄下SCN號(hào)

CHECKPOINT_CHANGE#

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

??1079203

1級(jí)差異備份

RMAN>?backup?incremental?level?1?database;

Starting?backup?at?10-MAY-13

using?channel?ORA_DISK_1

channel?ORA_DISK_1:?starting?incremental?level?1?datafile?backup?set

channel?ORA_DISK_1:?specifying?datafile(s)?in?backup?set

input?datafile?file?number=00001name=/u02/app/oracle/oradata/LEO1/system01.dbf

input?datafile?file?number=00002name=/u02/app/oracle/oradata/LEO1/sysaux01.dbf

input?datafile?file?number=00003?name=/u02/app/oracle/oradata/LEO1/undotbs01.dbf

input?datafile?file?number=00005name=/u02/app/oracle/oradata/LEO1/leo1.dbf

input?datafile?file?number=00006name=/u02/app/oracle/oradata/LEO1/test1_01.dbf???????這次多了test1表空間

input?datafile?file?number=00004name=/u02/app/oracle/oradata/LEO1/users01.dbf

channel?ORA_DISK_1:?starting?piece?1?at?10-MAY-13

channel?ORA_DISK_1:?finished?piece?1?at?10-MAY-13

piece?handle=/u02/app/oracle/backup/DB_0no99r4r_1_1?tag=TAG20130510T151746comment=NONE

channel?ORA_DISK_1:?backup?set?complete,?elapsed?time:?00:02:15

Finished?backup?at?10-MAY-13

Starting?Control?File?and?SPFILE?Autobackup?at?10-MAY-13

piece?handle=/u02/app/oracle/backup/control/cf_c-1692458681-20130510-01comment=NONE

Finished?Control?File?and?SPFILE?Autobackup?at?10-MAY-13

創(chuàng)建test2表空間

LEO1@LEO1>create?tablespace?test2?datafile'/u02/app/oracle/oradata/LEO1/test2_01.dbf'?size?20m?autoextend?off;

Tablespace?created.

創(chuàng)建test2表

LEO1@LEO1>create?table?test2?tablespace?test2?as?select?*?fromdba_objects;

Table?created.

LEO1@LEO1>select?checkpoint_change#?from?v$database;

CHECKPOINT_CHANGE#

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

1079213

再次1級(jí)差異備份

RMAN>?backup?incremental?level?1?database;


Starting?backup?at?10-MAY-13

using?channel?ORA_DISK_1

channel?ORA_DISK_1:?starting?incremental?level?1?datafile?backup?set

channel?ORA_DISK_1:?specifying?datafile(s)?in?backup?set

input?datafile?file?number=00001name=/u02/app/oracle/oradata/LEO1/system01.dbf

input?datafile?file?number=00002name=/u02/app/oracle/oradata/LEO1/sysaux01.dbf

input?datafile?file?number=00003name=/u02/app/oracle/oradata/LEO1/undotbs01.dbf

input?datafile?file?number=00005name=/u02/app/oracle/oradata/LEO1/leo1.dbf

input?datafile?file?number=00006name=/u02/app/oracle/oradata/LEO1/test1_01.dbf

input?datafile?file?number=00007?name=/u02/app/oracle/oradata/LEO1/test2_01.dbf????這次又多了test1表空間

input?datafile?file?number=00004name=/u02/app/oracle/oradata/LEO1/users01.dbf

channel?ORA_DISK_1:?starting?piece?1?at?10-MAY-13

channel?ORA_DISK_1:?finished?piece?1?at?10-MAY-13

piece?handle=/u02/app/oracle/backup/DB_0qo99s79_1_1?tag=TAG20130510T153609comment=NONE

channel?ORA_DISK_1:?backup?set?complete,?elapsed?time:?00:02:05

Finished?backup?at?10-MAY-13


Starting?Control?File?and?SPFILE?Autobackup?at?10-MAY-13

piece?handle=/u02/app/oracle/backup/control/cf_c-1692458681-20130510-03comment=NONE

Finished?Control?File?and?SPFILE?Autobackup?at?10-MAY-13

SYS@LEO1>select?checkpoint_change#?from?v$database;

CHECKPOINT_CHANGE#

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

1084254

SYS@LEO1>alter?system?switch?logfile;?????????我們做一次日志切換從2?->?3

System?altered.

SYS@LEO1>archive?log?list

Database?log?mode?????????????Archive?Mode

Automatic?archival????????????Enabled

Archive?destination???????????/u02/app/oracle/archdata

Oldest?online?log?sequence?????1

Next?log?sequence?to?archive???3

Current?log?sequence???????????3

SYS@LEO1>alter?system?switch?logfile;?????????為了保險(xiǎn)我們?cè)偾幸淮?#xff0c;當(dāng)前日志序號(hào)為4

System?altered.

SYS@LEO1>conn?leo1/leo1????????????????????????

Connected.

LEO1@LEO1>drop?table?test1?purge;?????????????我們刪除test1和test2表

Table?dropped.

LEO1@LEO1>drop?table?test2?purge;

Table?dropped.

現(xiàn)在我們想恢復(fù)到?jīng)]刪除之前的狀態(tài),有2種方法(1)恢復(fù)到scn=1084254?(2)恢復(fù)到sequence=3

檢查一下備份集集

RMAN>?list?backupset;

List?of?Backup?Sets

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

BS?Key??Type?LV?Size???????Device?Type?Elapsed?Time?Completion?Time

-------?----?--?----------?-----------?------------?---------------

19??????Incr?0??960.85M???DISK????????00:01:21?????10-MAY-13

????????BP?Key:?19???Status:?AVAILABLE??Compressed:?NO??Tag:?TAG20130510T150112

????????Piece?Name:/u02/app/oracle/backup/DB_0lo99q5p_1_1

??List?of?Datafiles?in?backup?set?19

??File?LV?Type?Ckp?SCN????Ckp?Time?Name

??----?--?----?----------?-------------

??1????0?Incr?1081294????10-MAY-13/u02/app/oracle/oradata/LEO1/system01.dbf

??2????0?Incr?1081294????10-MAY-13/u02/app/oracle/oradata/LEO1/sysaux01.dbf

??3????0?Incr?1081294????10-MAY-13/u02/app/oracle/oradata/LEO1/undotbs01.dbf

??4????0?Incr?1081294????10-MAY-13/u02/app/oracle/oradata/LEO1/users01.dbf

??5????0?Incr?1081294????10-MAY-13/u02/app/oracle/oradata/LEO1/leo1.dbf

BS?Key??Type?LV?Size???????Device?Type?Elapsed?Time?Completion?Time

-------?----?--?----------?-----------?------------?---------------

20??????Full????9.39M?????DISK????????00:00:01?????10-MAY-13??????

????????BP?Key:?20???Status:?AVAILABLE??Compressed:?NO??Tag:?TAG20130510T150238

????????Piece?Name:/u02/app/oracle/backup/control/cf_c-1692458681-20130510-00

??SPFILE?Included:?Modificationtime:?30-APR-13

??SPFILE?db_unique_name:?LEO1

??Control?File?Included:?Ckp?SCN:1081329??????Ckp?time:?10-MAY-13


BS?Key??Type?LV?Size???????Device?Type?Elapsed?Time?Completion?Time

-------?----?--?----------?-----------?------------?---------------

21??????Incr?1??19.38M????DISK????????00:02:08?????10-MAY-13

????????BP?Key:?21???Status:?AVAILABLE??Compressed:?NO??Tag:?TAG20130510T151746

????????Piece?Name:/u02/app/oracle/backup/DB_0no99r4r_1_1

??List?of?Datafiles?in?backup?set?21

??File?LV?Type?Ckp?SCN????Ckp?Time?Name

??----?--?----?----------?-------------

??1????1?Incr?1083510????10-MAY-13/u02/app/oracle/oradata/LEO1/system01.dbf

??2????1?Incr?1083510????10-MAY-13/u02/app/oracle/oradata/LEO1/sysaux01.dbf

??3????1?Incr?1083510????10-MAY-13/u02/app/oracle/oradata/LEO1/undotbs01.dbf

??4????1?Incr?1083510????10-MAY-13/u02/app/oracle/oradata/LEO1/users01.dbf

??5????1?Incr?1083510????10-MAY-13/u02/app/oracle/oradata/LEO1/leo1.dbf

??6????1?Incr?1083510????10-MAY-13/u02/app/oracle/oradata/LEO1/test1_01.dbf

BS?Key??Type?LV?Size???????Device?Type?Elapsed?Time?Completion?Time

-------?----?--?----------?-----------?------------?---------------

22??????Full????9.39M?????DISK????????00:00:01?????10-MAY-13??????

????????BP?Key:?22???Status:?AVAILABLE??Compressed:?NO??Tag:?TAG20130510T152002

????????Piece?Name:?/u02/app/oracle/backup/control/cf_c-1692458681-20130510-01

??SPFILE?Included:?Modificationtime:?10-MAY-13

??SPFILE?db_unique_name:?LEO1

??Control?File?Included:?Ckp?SCN:1083563??????Ckp?time:?10-MAY-13

BS?Key??Type?LV?Size???????Device?Type?Elapsed?Time?Completion?Time

-------?----?--?----------?-----------?------------?---------------

23??????Full????9.39M?????DISK????????00:00:02?????10-MAY-13??????

????????BP?Key:?23???Status:?AVAILABLE??Compressed:?NO??Tag:?TAG20130510T152849

????????Piece?Name:?/u02/app/oracle/backup/control/cf_c-1692458681-20130510-02

??SPFILE?Included:?Modificationtime:?10-MAY-13

??SPFILE?db_unique_name:?LEO1

??Control?File?Included:?Ckp?SCN:1084027??????Ckp?time:?10-MAY-13

BS?Key??Type?LV?Size???????Device?Type?Elapsed?Time?Completion?Time

-------?----?--?----------?-----------?------------?---------------

24??????Incr?1??9.90M?????DISK????????00:02:00?????10-MAY-13

????????BP?Key:?24???Status:?AVAILABLE??Compressed:?NO??Tag:?TAG20130510T153609

????????Piece?Name:/u02/app/oracle/backup/DB_0qo99s79_1_1

??List?of?Datafiles?in?backup?set?24

??File?LV?Type?Ckp?SCN????Ckp?Time?Name

??----?--?----?----------?-------------

??1????1?Incr?1084375????10-MAY-13/u02/app/oracle/oradata/LEO1/system01.dbf

??2????1?Incr?1084375????10-MAY-13?/u02/app/oracle/oradata/LEO1/sysaux01.dbf

??3????1?Incr?1084375????10-MAY-13/u02/app/oracle/oradata/LEO1/undotbs01.dbf

??4????1?Incr?1084375????10-MAY-13/u02/app/oracle/oradata/LEO1/users01.dbf

??5????1?Incr?1084375????10-MAY-13/u02/app/oracle/oradata/LEO1/leo1.dbf

??6????1?Incr?1084375????10-MAY-13/u02/app/oracle/oradata/LEO1/test1_01.dbf

??7????1?Incr?1084375????10-MAY-13/u02/app/oracle/oradata/LEO1/test2_01.dbf

BS?Key??Type?LV?Size???????Device?Type?Elapsed?Time?Completion?Time

-------?----?--?----------?-----------?------------?---------------

25??????Full????9.39M?????DISK????????00:00:01?????10-MAY-13??????

????????BP?Key:?25???Status:?AVAILABLE??Compressed:?NO??Tag:?TAG20130510T153814

????????Piece?Name:/u02/app/oracle/backup/control/cf_c-1692458681-20130510-03

??SPFILE?Included:?Modificationtime:?10-MAY-13

??SPFILE?db_unique_name:?LEO1

??Control?File?Included:?Ckp?SCN:1084436??????Ckp?time:?10-MAY-13

從這個(gè)size大小上就可以看出?960.85M->19.38M->9.90M咱們做的都是增量備份,那么好現(xiàn)在開始恢復(fù)

SYS@LEO1>shutdown?immediate?

Database?closed.

Database?dismounted.

ORACLE?instance?shut?down.

SYS@LEO1>startup?mount????????????????????????????????啟動(dòng)mount狀態(tài)恢復(fù)

ORACLE?instance?started.

Total?System?Global?Area??471830528bytes

Fixed?Size??????????????????2214456bytes

Variable?Size?????????????184550856?bytes

Database?Buffers??????????276824064bytes

Redo?Buffers????????????????8241152bytes

Database?mounted.

RMAN??進(jìn)行基于SCN號(hào)不完全恢復(fù)

RMAN>?restore?database?until?scn?1084254;

Starting?restore?at?10-MAY-13

using?target?database?control?file?instead?of?recovery?catalog

allocated?channel:?ORA_DISK_1

channel?ORA_DISK_1:?SID=10?device?type=DISK

creating?datafile?file?number=7name=/u02/app/oracle/oradata/LEO1/test2_01.dbf

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?00001?to/u02/app/oracle/oradata/LEO1/system01.dbf

channel?ORA_DISK_1:?restoring?datafile?00002?to/u02/app/oracle/oradata/LEO1/sysaux01.dbf

channel?ORA_DISK_1:?restoring?datafile?00003?to/u02/app/oracle/oradata/LEO1/undotbs01.dbf

channel?ORA_DISK_1:?restoring?datafile?00004?to/u02/app/oracle/oradata/LEO1/users01.dbf

channel?ORA_DISK_1:?restoring?datafile?00005?to/u02/app/oracle/oradata/LEO1/leo1.dbf

channel?ORA_DISK_1:?reading?from?backup?piece?/u02/app/oracle/backup/DB_0lo99q5p_1_1????從0級(jí)備份開始恢復(fù)

channel?ORA_DISK_1:?piece?handle=/u02/app/oracle/backup/DB_0lo99q5p_1_1tag=TAG20130510T150112

channel?ORA_DISK_1:?restored?backup?piece?1

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

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?00006?to/u02/app/oracle/oradata/LEO1/test1_01.dbf

channel?ORA_DISK_1:?reading?from?backup?piece?/u02/app/oracle/backup/DB_0no99r4r_1_1????再恢復(fù)1級(jí)

channel?ORA_DISK_1:?piece?handle=/u02/app/oracle/backup/DB_0no99r4r_1_1tag=TAG20130510T151746

channel?ORA_DISK_1:?restored?backup?piece?1

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

Finished?restore?at?10-MAY-13

RMAN>?recover?database?until?scn?1084254;????????????????????同步scn號(hào)

Starting?recover?at?10-MAY-13

using?channel?ORA_DISK_1

channel?ORA_DISK_1:?starting?incremental?datafile?backup?set?restore

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

destination?for?restore?of?datafile?00001:/u02/app/oracle/oradata/LEO1/system01.dbf

destination?for?restore?of?datafile?00002:/u02/app/oracle/oradata/LEO1/sysaux01.dbf

destination?for?restore?of?datafile?00003:/u02/app/oracle/oradata/LEO1/undotbs01.dbf

destination?for?restore?of?datafile?00004:/u02/app/oracle/oradata/LEO1/users01.dbf

destination?for?restore?of?datafile?00005:/u02/app/oracle/oradata/LEO1/leo1.dbf

channel?ORA_DISK_1:?reading?from?backup?piece/u02/app/oracle/backup/DB_0no99r4r_1_1

channel?ORA_DISK_1:?piece?handle=/u02/app/oracle/backup/DB_0no99r4r_1_1tag=TAG20130510T151746

channel?ORA_DISK_1:?restored?backup?piece?1

channel?ORA_DISK_1:?restore?complete,?elapsed?time:?00:00:03

starting?media?recovery

archived?log?for?thread?1?with?sequence?1?is?already?on?disk?as?file/u02/app/oracle/archdata/1_1_814107939.dbf

archived?log?file?name=/u02/app/oracle/archdata/1_1_814107939.dbf?thread=1sequence=1

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

Finished?recover?at?10-MAY-13

RMAN>?alter?database?open?resetlogs;?????????非一致性打開

database?opened

累積增量備份

零級(jí)備份

backup?incremental?level?0?cumulative?database;

創(chuàng)建表空間test3

創(chuàng)建表test3

一級(jí)累積備份

backup?incremental?level?1?cumulative?database;

創(chuàng)建表空間test4

創(chuàng)建表test4

一級(jí)累積備份

backup?incremental?level?1?cumulative?database;

記住當(dāng)前的sequence號(hào),我們刪除表test3和表test4,然后恢復(fù)到sequence那一刻,檢查表test3和表test4是否完整恢復(fù)回來(lái),恢復(fù)窗口:恢復(fù)兩個(gè)備份集?0+1(最后一次備份)+redo

下面我們就做的快一點(diǎn)啦

RMAN>?backup?incremental?level?0?cumulative?database;?????????????????0級(jí)累積增量備份


Starting?backup?at?10-MAY-13

using?channel?ORA_DISK_1

channel?ORA_DISK_1:?starting?incremental?level?0?datafile?backup?set

channel?ORA_DISK_1:?specifying?datafile(s)?in?backup?set

input?datafile?file?number=00001?name=/u02/app/oracle/oradata/LEO1/system01.dbf

input?datafile?file?number=00002name=/u02/app/oracle/oradata/LEO1/sysaux01.dbf

input?datafile?file?number=00003name=/u02/app/oracle/oradata/LEO1/undotbs01.dbf

input?datafile?file?number=00005name=/u02/app/oracle/oradata/LEO1/leo1.dbf

input?datafile?file?number=00006name=/u02/app/oracle/oradata/LEO1/test1_01.dbf

input?datafile?file?number=00007name=/u02/app/oracle/oradata/LEO1/test2_01.dbf

input?datafile?file?number=00004name=/u02/app/oracle/oradata/LEO1/users01.dbf

channel?ORA_DISK_1:?starting?piece?1?at?10-MAY-13

channel?ORA_DISK_1:?finished?piece?1?at?10-MAY-13

piece?handle=/u02/app/oracle/backup/DB_0to99v4v_1_1?tag=TAG20130510T162607comment=NONE

channel?ORA_DISK_1:?backup?set?complete,?elapsed?time:?00:01:25

Finished?backup?at?10-MAY-13


Starting?Control?File?and?SPFILE?Autobackup?at?10-MAY-13

piece?handle=/u02/app/oracle/backup/control/cf_c-1692458681-20130510-05comment=NONE

Finished?Control?File?and?SPFILE?Autobackup?at?10-MAY-13

創(chuàng)建表空間和表test3

LEO1@LEO1>create?tablespace?test3?datafile'/u02/app/oracle/oradata/LEO1/test3_01.dbf'?size?20m?autoextend?off;

Tablespace?created.

LEO1@LEO1>create?table?test3?tablespace?test3?as?select?*?fromdba_objects;

Table?created.

1級(jí)累積備份

RMAN>?backup?incremental?level?1?cumulative?database;


Starting?backup?at?10-MAY-13

using?channel?ORA_DISK_1

channel?ORA_DISK_1:?starting?incremental?level?1?datafile?backup?set

channel?ORA_DISK_1:?specifying?datafile(s)?in?backup?set

input?datafile?file?number=00001name=/u02/app/oracle/oradata/LEO1/system01.dbf

input?datafile?file?number=00002name=/u02/app/oracle/oradata/LEO1/sysaux01.dbf

input?datafile?file?number=00003name=/u02/app/oracle/oradata/LEO1/undotbs01.dbf

input?datafile?file?number=00005name=/u02/app/oracle/oradata/LEO1/leo1.dbf

input?datafile?file?number=00006name=/u02/app/oracle/oradata/LEO1/test1_01.dbf

input?datafile?file?number=00007name=/u02/app/oracle/oradata/LEO1/test2_01.dbf

input?datafile?file?number=00008name=/u02/app/oracle/oradata/LEO1/test3_01.dbf

input?datafile?file?number=00004?name=/u02/app/oracle/oradata/LEO1/users01.dbf

channel?ORA_DISK_1:?starting?piece?1?at?10-MAY-13

channel?ORA_DISK_1:?finished?piece?1?at?10-MAY-13

piece?handle=?/u02/app/oracle/backup/DB_0vo99vgi_1_1?tag=TAG20130510T163217?comment=NONE

channel?ORA_DISK_1:?backup?set?complete,?elapsed?time:?00:02:05

Finished?backup?at?10-MAY-13


Starting?Control?File?and?SPFILE?Autobackup?at?10-MAY-13

piece?handle=/u02/app/oracle/backup/control/cf_c-1692458681-20130510-06comment=NONE

Finished?Control?File?and?SPFILE?Autobackup?at?10-MAY-13

創(chuàng)建表空間和表test4

LEO1@LEO1>create?tablespace?test4?datafile'/u02/app/oracle/oradata/LEO1/test4_01.dbf'?size?20m?autoextend?off;

Tablespace?created.

LEO1@LEO1>create?table?test4?tablespace?test4?as?select?*?fromdba_objects;

Table?created.

再一次1級(jí)累積備份

RMAN>?backup?incremental?level?1?cumulative?database;


Starting?backup?at?10-MAY-13

using?channel?ORA_DISK_1

channel?ORA_DISK_1:?starting?incremental?level?1?datafile?backup?set

channel?ORA_DISK_1:?specifying?datafile(s)?in?backup?set

input?datafile?file?number=00001name=/u02/app/oracle/oradata/LEO1/system01.dbf

input?datafile?file?number=00002name=/u02/app/oracle/oradata/LEO1/sysaux01.dbf

input?datafile?file?number=00003name=/u02/app/oracle/oradata/LEO1/undotbs01.dbf

input?datafile?file?number=00005?name=/u02/app/oracle/oradata/LEO1/leo1.dbf

input?datafile?file?number=00006name=/u02/app/oracle/oradata/LEO1/test1_01.dbf

input?datafile?file?number=00007name=/u02/app/oracle/oradata/LEO1/test2_01.dbf

input?datafile?file?number=00008?name=/u02/app/oracle/oradata/LEO1/test3_01.dbf

input?datafile?file?number=00009name=/u02/app/oracle/oradata/LEO1/test4_01.dbf

input?datafile?file?number=00004name=/u02/app/oracle/oradata/LEO1/users01.dbf

channel?ORA_DISK_1:?starting?piece?1?at?10-MAY-13

channel?ORA_DISK_1:?finished?piece?1?at?10-MAY-13

piece?handle=?/u02/app/oracle/backup/DB_11o99vpa_1_1?tag=TAG20130510T163657?comment=NONE

channel?ORA_DISK_1:?backup?set?complete,?elapsed?time:?00:01:55

Finished?backup?at?10-MAY-13


Starting?Control?File?and?SPFILE?Autobackup?at?10-MAY-13

piece?handle=/u02/app/oracle/backup/control/cf_c-1692458681-20130510-07comment=NONE

Finished?Control?File?and?SPFILE?Autobackup?at?10-MAY-13

SYS@LEO1>drop?table?test3?purge;

SYS@LEO1>drop?table?test4?purge;

切換2次日志

SYS@LEO1>alter?system?switch?logfile;

System?altered.

SYS@LEO1>alter?system?switch?logfile;

System?altered.

SYS@LEO1>archive?log?list

Database?log?mode?????????????Archive?Mode

Automatic?archival????????????Enabled

Archive?destination???????????/u02/app/oracle/archdata

Oldest?online?log?sequence?????3

Next?log?sequence?to?archive???5

Current?log?sequence???????????5

我們只需恢復(fù)到sequence=4即可

RMAN??進(jìn)行基于sequence號(hào)不完全恢復(fù)

SYS@LEO1>shutdown?immediate

SYS@LEO1>startup?mount

RMAN>?restore?database?until?sequence?4?thread?1;????????????????一直恢復(fù)到4號(hào)歸檔日志


Starting?restore?at?10-MAY-13

using?target?database?control?file?instead?of?recovery?catalog

allocated?channel:?ORA_DISK_1

channel?ORA_DISK_1:?SID=10?device?type=DISK


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?00001?to/u02/app/oracle/oradata/LEO1/system01.dbf

channel?ORA_DISK_1:?restoring?datafile?00002?to/u02/app/oracle/oradata/LEO1/sysaux01.dbf

channel?ORA_DISK_1:?restoring?datafile?00003?to/u02/app/oracle/oradata/LEO1/undotbs01.dbf

channel?ORA_DISK_1:?restoring?datafile?00004?to/u02/app/oracle/oradata/LEO1/users01.dbf

channel?ORA_DISK_1:?restoring?datafile?00005?to/u02/app/oracle/oradata/LEO1/leo1.dbf

channel?ORA_DISK_1:?restoring?datafile?00006?to/u02/app/oracle/oradata/LEO1/test1_01.dbf

channel?ORA_DISK_1:?restoring?datafile?00007?to/u02/app/oracle/oradata/LEO1/test2_01.dbf

channel?ORA_DISK_1:?reading?from?backup?piece/u02/app/oracle/backup/DB_0to99v4v_1_1

channel?ORA_DISK_1:?piece?handle=?/u02/app/oracle/backup/DB_0to99v4v_1_1?tag=TAG20130510T162607

channel?ORA_DISK_1:?restored?backup?piece?1

channel?ORA_DISK_1:?restore?complete,?elapsed?time:?00:02:05

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?00008?to/u02/app/oracle/oradata/LEO1/test3_01.dbf

channel?ORA_DISK_1:?restoring?datafile?00009?to/u02/app/oracle/oradata/LEO1/test4_01.dbf

channel?ORA_DISK_1:?reading?from?backup?piece/u02/app/oracle/backup/DB_11o99vpa_1_1

channel?ORA_DISK_1:?piece?handle=?/u02/app/oracle/backup/DB_11o99vpa_1_1?tag=TAG20130510T163657

channel?ORA_DISK_1:?restored?backup?piece?1

channel?ORA_DISK_1:?restore?complete,?elapsed?time:?00:00:03

Finished?restore?at?10-MAY-13


RMAN>?recover?database?until?sequence?4?thread?1;


Starting?recover?at?10-MAY-13

using?channel?ORA_DISK_1

channel?ORA_DISK_1:?starting?incremental?datafile?backup?set?restore

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

destination?for?restore?of?datafile?00001:/u02/app/oracle/oradata/LEO1/system01.dbf

destination?for?restore?of?datafile?00002:/u02/app/oracle/oradata/LEO1/sysaux01.dbf

destination?for?restore?of?datafile?00003:?/u02/app/oracle/oradata/LEO1/undotbs01.dbf

destination?for?restore?of?datafile?00004:/u02/app/oracle/oradata/LEO1/users01.dbf

destination?for?restore?of?datafile?00005:/u02/app/oracle/oradata/LEO1/leo1.dbf

destination?for?restore?of?datafile?00006:?/u02/app/oracle/oradata/LEO1/test1_01.dbf

destination?for?restore?of?datafile?00007:/u02/app/oracle/oradata/LEO1/test2_01.dbf

channel?ORA_DISK_1:?reading?from?backup?piece/u02/app/oracle/backup/DB_11o99vpa_1_1

channel?ORA_DISK_1:?piece?handle=?/u02/app/oracle/backup/DB_11o99vpa_1_1?tag=TAG20130510T163657

channel?ORA_DISK_1:?restored?backup?piece?1

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


starting?media?recovery


archived?log?for?thread?1?with?sequence?3?is?already?on?disk?as?file/u02/app/oracle/archdata/1_3_815069267.dbf

archived?log?file?name=/u02/app/oracle/archdata/1_3_815069267.dbf?thread=1sequence=3

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

Finished?recover?at?10-MAY-13

RMAN>?alter?database?open?resetlogs;?????????打開數(shù)據(jù)庫(kù)

database?opened

LEO1@LEO1>select?count(*)?from?test3;????????完整恢復(fù)回來(lái)啦

??COUNT(*)

----------

????71894

LEO1@LEO1>select?count(*)?from?test4;????????

??COUNT(*)

----------

?????71895

大家肯定會(huì)發(fā)現(xiàn)一個(gè)有趣的現(xiàn)象,我們備份集順序DB_0to99v4v_1_1->DB_0vo99vgi_1_1->DB_11o99vpa_1_1

-rw-r-----?1?oracle?asmadmin?1023426560?May?10?16:27?DB_0to99v4v_1_1

-rw-r-----?1?oracle?asmadmin??10493952?May?10?16:34?DB_0vo99vgi_1_1

-rw-r-----?1?oracle?asmadmin??20193280?May?10?16:38?DB_11o99vpa_1_1

而我們恢復(fù)順序DB_0to99v4v_1_1->DB_11o99vpa_1_1,沒有中間的DB_0vo99vgi_1_1,這就是累積增量備份的特色,當(dāng)進(jìn)行備份時(shí)它要去找比它自己級(jí)別小的基準(zhǔn)點(diǎn)進(jìn)行增量備份,因此DB_11o99vpa_1_1是從0級(jí)一直備到最新狀態(tài)(包括DB_0vo99vgi_1_1)又根據(jù)Oracle優(yōu)先使用備份集恢復(fù),用完所有備份集后,在應(yīng)用歸檔日志恢復(fù),因?yàn)閭浞菁时葰w檔快很多,這一原則,我們可以直接使用DB_11o99vpa_1_1備份集進(jìn)行恢復(fù)了。

小結(jié):情深深雨蒙蒙~風(fēng)吹草低見牛羊,示例說(shuō)明兩種增量備份的差別實(shí)驗(yàn)已經(jīng)完成,大家從這些實(shí)驗(yàn)中學(xué)習(xí)到東西了嘛!應(yīng)該說(shuō)這兩種增量各有千秋,適合不同的應(yīng)用場(chǎng)景,如何更好的使用它們,要根據(jù)你項(xiàng)目能夠接受的備份及恢復(fù)程度而定,好了我們明天見goodbye?親。


3.演示用catalog數(shù)據(jù)庫(kù)作為RMAN的資料庫(kù)對(duì)數(shù)據(jù)庫(kù)進(jìn)行一次全備份

上面我們說(shuō)過(guò)RMAN元數(shù)據(jù)可以放在控制文件中,其實(shí)還可以放在catalog數(shù)據(jù)庫(kù)中,catalog庫(kù)是個(gè)什么東東呢?我們簡(jiǎn)單的闡述一下它個(gè)功能。

1.??catalog庫(kù)統(tǒng)一管理RMAN備份信息即元數(shù)據(jù)信息,如果沒有catalog庫(kù),就把RMAN備份信息寫入控制文件

2.??目標(biāo)數(shù)據(jù)庫(kù)必須注冊(cè)到catalog庫(kù)中才能使用

3.??控制文件恢復(fù)成本越來(lái)越低,降低了catalog庫(kù)使用。

4.??控制文件不能保留超過(guò)一年以上的備份信息,catalog可卻可以。

5.??catalog庫(kù)可以同時(shí)保存n臺(tái)數(shù)據(jù)庫(kù)的備份信息,降低管理成本,提升管理效率

參考官方文檔

【參】Books->Backup?and?Recovery?Reference?->?CREATE?CATALOG和REGISTER

【參】Books->?Backup?and?Recovery?Advanced?Users?Guide?->?10?Managing?the?RecoveryCatalog?->?Creating?a?Recovery?Catalog

1.創(chuàng)建表空間catalog1?用于存儲(chǔ)rman備份信息,創(chuàng)建表空間代表【catalog庫(kù)】

LEO1@LEO1>create?tablespace?catalog1?datafile'/u02/app/oracle/oradata/LEO1/catalog1_01.dbf'?size?20m?autoextend?off;

Tablespace?created.

2.創(chuàng)建用戶cl_admin并指定默認(rèn)的表空間catalog1

LEO1@LEO1>create?user?cl_admin?identified?by?cl_admin?defaulttablespace?catalog1;

User?created.

3.將recovery_catalog_owner角色授予給cl_admin用戶,才能提供維護(hù)和查詢恢復(fù)目錄的權(quán)限

LEO1@LEO1>grant?connect,resource,recovery_catalog_owner?to?cl_admin;

Grant?succeeded.

LEO1@LEO1>select?*?from?dba_roles?where?role?like?'%RECOVER%';??????????????

ROLE??????????????????????????PASSWORD?AUTHENTICAT

------------------------------?--------?-----------

RECOVERY_CATALOG_OWNER????????NO???????NONE

LEO1@LEO1>conn?/?as?sysdba

Connected.

SYS@LEO1>select?*?from?role_sys_privs?whererole='RECOVERY_CATALOG_OWNER';????查看這個(gè)角色具有哪些系統(tǒng)權(quán)限->11個(gè)權(quán)限

ROLE??????????????????????????PRIVILEGE???????????????????????????????ADM

------------------------------?-------------------------------------------

RECOVERY_CATALOG_OWNER????????CREATE?SYNONYM??????????????????????????NO

RECOVERY_CATALOG_OWNER????????CREATE?CLUSTER??????????????????????????NO

RECOVERY_CATALOG_OWNER?????????ALTERSESSION????????????????????????????NO

RECOVERY_CATALOG_OWNER????????CREATE?DATABASE?LINK????????????????????NO

RECOVERY_CATALOG_OWNER????????CREATE?SESSION??????????????????????????NO

RECOVERY_CATALOG_OWNER????????CREATE?TABLE????????????????????????????NO

RECOVERY_CATALOG_OWNER????????CREATE?SEQUENCE?????????????????????????NO

RECOVERY_CATALOG_OWNER?????????CREATEPROCEDURE?????????????????????????NO

RECOVERY_CATALOG_OWNER????????CREATE?VIEW?????????????????????????????NO

RECOVERY_CATALOG_OWNER????????CREATE?TYPE?????????????????????????????NO

RECOVERY_CATALOG_OWNER????????CREATE?TRIGGER???????????????????????????NO

11?rows?selected.

4.進(jìn)入rman創(chuàng)建恢復(fù)目錄catalog庫(kù)

[oracle@leonarding1?backup]$?rman?catalog?cl_admin/cl_admin?????????????以恢復(fù)目錄所有者身份登錄rman

Recovery?Manager:?Release?11.2.0.1.0?-?Production?on?Sat?May?11?09:06:292013

Copyright?(c)?1982,?2009,?Oracle?and/or?its?affiliates.??All?rights?reserved.

connected?to?recovery?catalog?database?????????????????????????????????連接到恢復(fù)目錄數(shù)據(jù)庫(kù)

RMAN>?create?catalog?tablespace?catalog1;????????????????????用catalog1表空間代表catalog庫(kù)

recovery?catalog?created

5.target庫(kù)注冊(cè)到catalog庫(kù)

[oracle@leonarding1?backup]$?rman?target?sys/oracle?catalogcl_admin/cl_admin

Recovery?Manager:?Release?11.2.0.1.0?-?Production?on?Sat?May?11?09:15:102013

Copyright?(c)?1982,?2009,?Oracle?and/or?its?affiliates.??All?rights?reserved.

connected?to?target?database:?LEO1?(DBID=1692458681)??必須以SYS身份登錄,不能以普通用戶身份登錄,否則不能注冊(cè)

connected?to?recovery?catalog?database????????????????同時(shí)也連接到了catalog庫(kù)

RMAN>?register?database;????????????????把target庫(kù)->注冊(cè)->catalog庫(kù),誰(shuí)注冊(cè)了誰(shuí)的備份信息才能存到catalog庫(kù)

database?registered?in?recovery?catalog

starting?full?resync?of?recovery?catalog

full?resync?complete

6.在數(shù)據(jù)庫(kù)中確認(rèn)注冊(cè)成功,看看哪些數(shù)據(jù)庫(kù)注冊(cè)到catalog庫(kù)了

[oracle@leonarding1?~]$?sqlplus?cl_admin/cl_admin

CL_ADMIN@LEO1>col?name?for?a6

CL_ADMIN@LEO1>select?*?from?rc_database;?????????從這個(gè)視圖上我們就可以看到leo1庫(kù)已經(jīng)注冊(cè)到catalog中了

????DB_KEY??DBINC_KEY???????DBID?NAME???RESETLOGS_CHANGE#?RESETLOGS

----------?----------?----------?------?-----------------?---------

?????????2??????????4?1692458681?LEO1?????????????1086803?10-MAY-13

7.取消注冊(cè)

RMAN>?unregister?database;??????????????????????????????????????????從恢復(fù)目錄庫(kù)中取消目標(biāo)數(shù)據(jù)庫(kù)的注冊(cè)

8.全庫(kù)備份

RMAN>?backup?as?compressed?backupset?full?database?include?currentcontrolfile?plus?archivelog?delete?all?input;

Starting?backup?at?11-MAY-13

current?log?archived

allocated?channel:?ORA_DISK_1

channel?ORA_DISK_1:?SID=19?device?type=DISK

channel?ORA_DISK_1:?starting?compressed?archived?log?backup?set

channel?ORA_DISK_1:?specifying?archived?log(s)?in?backup?set

input?archived?log?thread=1?sequence=6?RECID=38?STAMP=814107533

input?archived?log?thread=1?sequence=7?RECID=36?STAMP=814105467

channel?ORA_DISK_1:?starting?piece?1?at?11-MAY-13

channel?ORA_DISK_1:?finished?piece?1?at?11-MAY-13

piece?handle=/u02/app/oracle/backup/DB_15o9bs9s_1_1?tag=TAG20130511T094947comment=NONE

channel?ORA_DISK_1:?backup?set?complete,?elapsed?time:?00:00:01

channel?ORA_DISK_1:?deleting?archived?log(s)

archived?log?file?name=/u02/app/oracle/archdata/1_6_814098124.dbf?RECID=38STAMP=814107533

archived?log?file?name=/u02/app/oracle/archdata/1_7_814098124.dbf?RECID=36STAMP=814105467

channel?ORA_DISK_1:?starting?compressed?archived?log?backup?set

channel?ORA_DISK_1:?specifying?archived?log(s)?in?backup?set

input?archived?log?thread=1?sequence=1?RECID=39?STAMP=815067081

channel?ORA_DISK_1:?starting?piece?1?at?11-MAY-13

channel?ORA_DISK_1:?finished?piece?1?at?11-MAY-13

piece?handle=/u02/app/oracle/backup/DB_16o9bs9t_1_1?tag=TAG20130511T094947comment=NONE

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

channel?ORA_DISK_1:?deleting?archived?log(s)

archived?log?file?name=/u02/app/oracle/archdata/1_1_814107939.dbf?RECID=39STAMP=815067081

channel?ORA_DISK_1:?starting?compressed?archived?log?backup?set

channel?ORA_DISK_1:?specifying?archived?log(s)?in?backup?set

input?archived?log?thread=1?sequence=8?RECID=37?STAMP=814105539

channel?ORA_DISK_1:?starting?piece?1?at?11-MAY-13

channel?ORA_DISK_1:?finished?piece?1?at?11-MAY-13

piece?handle=/u02/app/oracle/backup/DB_17o9bsa1_1_1?tag=TAG20130511T094947comment=NONE

channel?ORA_DISK_1:?backup?set?complete,?elapsed?time:?00:00:01

channel?ORA_DISK_1:?deleting?archived?log(s)

archived?log?file?name=/u02/app/oracle/archdata/1_8_814098124.dbf?RECID=37STAMP=814105539

channel?ORA_DISK_1:?starting?compressed?archived?log?backup?set

channel?ORA_DISK_1:?specifying?archived?log(s)?in?backup?set

input?archived?log?thread=1?sequence=2?RECID=40?STAMP=815067673

channel?ORA_DISK_1:?starting?piece?1?at?11-MAY-13

channel?ORA_DISK_1:?finished?piece?1?at?11-MAY-13

piece?handle=/u02/app/oracle/backup/DB_18o9bsa2_1_1?tag=TAG20130511T094947comment=NONE

channel?ORA_DISK_1:?backup?set?complete,?elapsed?time:?00:00:01

channel?ORA_DISK_1:?deleting?archived?log(s)

archived?log?file?name=/u02/app/oracle/archdata/1_2_814107939.dbf?RECID=40STAMP=815067673

channel?ORA_DISK_1:?starting?compressed?archived?log?backup?set

channel?ORA_DISK_1:?specifying?archived?log(s)?in?backup?set

input?archived?log?thread=1?sequence=1?RECID=43?STAMP=815070347

channel?ORA_DISK_1:?starting?piece?1?at?11-MAY-13

channel?ORA_DISK_1:?finished?piece?1?at?11-MAY-13

piece?handle=/u02/app/oracle/backup/DB_19o9bsa3_1_1?tag=TAG20130511T094947comment=NONE

channel?ORA_DISK_1:?backup?set?complete,?elapsed?time:?00:00:01

channel?ORA_DISK_1:?deleting?archived?log(s)

archived?log?file?name=/u02/app/oracle/archdata/1_1_815069267.dbf?RECID=43STAMP=815070347

channel?ORA_DISK_1:?starting?compressed?archived?log?backup?set

channel?ORA_DISK_1:?specifying?archived?log(s)?in?backup?set

input?archived?log?thread=1?sequence=3?RECID=41?STAMP=815067752

input?archived?log?thread=1?sequence=4?RECID=42?STAMP=815069267

channel?ORA_DISK_1:?starting?piece?1?at?11-MAY-13

channel?ORA_DISK_1:?finished?piece?1?at?11-MAY-13

piece?handle=/u02/app/oracle/backup/DB_1ao9bsa4_1_1?tag=TAG20130511T094947comment=NONE

channel?ORA_DISK_1:?backup?set?complete,?elapsed?time:?00:00:01

channel?ORA_DISK_1:?deleting?archived?log(s)

archived?log?file?name=/u02/app/oracle/archdata/1_3_814107939.dbf?RECID=41STAMP=815067752

archived?log?file?name=/u02/app/oracle/archdata/1_4_814107939.dbf?RECID=42STAMP=815069267

channel?ORA_DISK_1:?starting?compressed?archived?log?backup?set

channel?ORA_DISK_1:?specifying?archived?log(s)?in?backup?set

input?archived?log?thread=1?sequence=2?RECID=44?STAMP=815070349

input?archived?log?thread=1?sequence=3?RECID=45?STAMP=815071289

input?archived?log?thread=1?sequence=4?RECID=46?STAMP=815071321

channel?ORA_DISK_1:?starting?piece?1?at?11-MAY-13

channel?ORA_DISK_1:?finished?piece?1?at?11-MAY-13

piece?handle=/u02/app/oracle/backup/DB_1bo9bsa5_1_1?tag=TAG20130511T094947comment=NONE

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

channel?ORA_DISK_1:?deleting?archived?log(s)

archived?log?file?name=/u02/app/oracle/archdata/1_2_815069267.dbf?RECID=44STAMP=815070349

archived?log?file?name=/u02/app/oracle/archdata/1_3_815069267.dbf?RECID=45STAMP=815071289

archived?log?file?name=/u02/app/oracle/archdata/1_4_815069267.dbf?RECID=46STAMP=815071321

channel?ORA_DISK_1:?starting?compressed?archived?log?backup?set

channel?ORA_DISK_1:?specifying?archived?log(s)?in?backup?set

input?archived?log?thread=1?sequence=1?RECID=48?STAMP=815130519

channel?ORA_DISK_1:?starting?piece?1?at?11-MAY-13

channel?ORA_DISK_1:?finished?piece?1?at?11-MAY-13

piece?handle=/u02/app/oracle/backup/DB_1co9bsa9_1_1?tag=TAG20130511T094947comment=NONE

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

channel?ORA_DISK_1:?deleting?archived?log(s)

archived?log?file?name=/u02/app/oracle/archdata/1_1_815071959.dbf?RECID=48STAMP=815130519

channel?ORA_DISK_1:?starting?compressed?archived?log?backup?set

channel?ORA_DISK_1:?specifying?archived?log(s)?in?backup?set

input?archived?log?thread=1?sequence=5?RECID=47?STAMP=815071959

channel?ORA_DISK_1:?starting?piece?1?at?11-MAY-13

channel?ORA_DISK_1:?finished?piece?1?at?11-MAY-13

piece?handle=/u02/app/oracle/backup/DB_1do9bsag_1_1?tag=TAG20130511T094947comment=NONE

channel?ORA_DISK_1:?backup?set?complete,?elapsed?time:?00:00:01

channel?ORA_DISK_1:?deleting?archived?log(s)

archived?log?file?name=/u02/app/oracle/archdata/1_5_815069267.dbf?RECID=47STAMP=815071959

channel?ORA_DISK_1:?starting?compressed?archived?log?backup?set

channel?ORA_DISK_1:?specifying?archived?log(s)?in?backup?set

input?archived?log?thread=1?sequence=2?RECID=49?STAMP=815132985

channel?ORA_DISK_1:?starting?piece?1?at?11-MAY-13

channel?ORA_DISK_1:?finished?piece?1?at?11-MAY-13

piece?handle=/u02/app/oracle/backup/DB_1eo9bsai_1_1?tag=TAG20130511T094947comment=NONE

channel?ORA_DISK_1:?backup?set?complete,?elapsed?time:?00:00:01

channel?ORA_DISK_1:?deleting?archived?log(s)

archived?log?file?name=/u02/app/oracle/archdata/1_2_815071959.dbf?RECID=49STAMP=815132985

Finished?backup?at?11-MAY-13


Starting?backup?at?11-MAY-13

using?channel?ORA_DISK_1

channel?ORA_DISK_1:?starting?compressed?full?datafile?backup?set

channel?ORA_DISK_1:?specifying?datafile(s)?in?backup?set

input?datafile?file?number=00001name=/u02/app/oracle/oradata/LEO1/system01.dbf

input?datafile?file?number=00002name=/u02/app/oracle/oradata/LEO1/sysaux01.dbf

input?datafile?file?number=00003name=/u02/app/oracle/oradata/LEO1/undotbs01.dbf

input?datafile?file?number=00005?name=/u02/app/oracle/oradata/LEO1/leo1.dbf

input?datafile?file?number=00006name=/u02/app/oracle/oradata/LEO1/test1_01.dbf

input?datafile?file?number=00007name=/u02/app/oracle/oradata/LEO1/test2_01.dbf

input?datafile?file?number=00008?name=/u02/app/oracle/oradata/LEO1/test3_01.dbf

input?datafile?file?number=00009name=/u02/app/oracle/oradata/LEO1/test4_01.dbf

input?datafile?file?number=00010name=/u02/app/oracle/oradata/LEO1/catalog1_01.dbf

input?datafile?file?number=00004?name=/u02/app/oracle/oradata/LEO1/users01.dbf

channel?ORA_DISK_1:?starting?piece?1?at?11-MAY-13

channel?ORA_DISK_1:?finished?piece?1?at?11-MAY-13

piece?handle=/u02/app/oracle/backup/DB_1fo9bsaj_1_1?tag=TAG20130511T095011comment=NONE

channel?ORA_DISK_1:?backup?set?complete,?elapsed?time:?00:01:35

channel?ORA_DISK_1:?starting?compressed?full?datafile?backup?set

channel?ORA_DISK_1:?specifying?datafile(s)?in?backup?set

including?current?control?file?in?backup?set

channel?ORA_DISK_1:?starting?piece?1?at?11-MAY-13

channel?ORA_DISK_1:?finished?piece?1?at?11-MAY-13

piece?handle=/u02/app/oracle/backup/DB_1go9bsdi_1_1?tag=TAG20130511T095011comment=NONE

channel?ORA_DISK_1:?backup?set?complete,?elapsed?time:?00:00:01

Finished?backup?at?11-MAY-13


Starting?backup?at?11-MAY-13

current?log?archived

using?channel?ORA_DISK_1

channel?ORA_DISK_1:?starting?compressed?archived?log?backup?set

channel?ORA_DISK_1:?specifying?archived?log(s)?in?backup?set

input?archived?log?thread=1?sequence=3?RECID=50?STAMP=815133109

channel?ORA_DISK_1:?starting?piece?1?at?11-MAY-13

channel?ORA_DISK_1:?finished?piece?1?at?11-MAY-13

piece?handle=/u02/app/oracle/backup/DB_1ho9bsdm_1_1?tag=TAG20130511T095150comment=NONE

channel?ORA_DISK_1:?backup?set?complete,?elapsed?time:?00:00:01

channel?ORA_DISK_1:?deleting?archived?log(s)

archived?log?file?name=/u02/app/oracle/archdata/1_3_815071959.dbf?RECID=50STAMP=815133109

Finished?backup?at?11-MAY-13


Starting?Control?File?and?SPFILE?Autobackup?at?11-MAY-13

piece?handle=/u02/app/oracle/backup/control/cf_c-1692458681-20130511-01comment=NONE

Finished?Control?File?and?SPFILE?Autobackup?at?11-MAY-13

這些備份信息就會(huì)保存在catalog數(shù)據(jù)庫(kù)中,你可以同時(shí)保存n臺(tái)數(shù)據(jù)庫(kù)的備份信息,請(qǐng)注意一點(diǎn),catalog庫(kù)也會(huì)有crash風(fēng)險(xiǎn),如果這些備份信息丟失那么所有備份集就會(huì)失效,因此catalog庫(kù)也需要備份。

小結(jié):備份與恢復(fù)是數(shù)據(jù)庫(kù)的一個(gè)核心模塊,幾乎沒有見過(guò)無(wú)需備份的庫(kù),RMAN是oracle專用級(jí)備份與恢復(fù)工具,幾乎可以完成所有的備份任務(wù),是我們DBA的利器,因此花些時(shí)間學(xué)習(xí)RMAN是很有意義的。以此文紀(jì)念成長(zhǎng)ing我們:)?晚安親



RMAN???backupset??catalog???全庫(kù)備份??差異增量備份??累積增量備份






本文轉(zhuǎn)自 ztfriend 51CTO博客,原文鏈接:http://blog.51cto.com/leonarding/1198319,如需轉(zhuǎn)載請(qǐng)自行聯(lián)系原作者

總結(jié)

以上是生活随笔為你收集整理的RMAN 备份与恢复深入解析(二)的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。