加快RMAN增量備份的速度(block change tracking特性)
9i的增量備份,要掃描所有使用過的塊,應該沒啥辦法吧,10g有了新特性block change tracking就好點
這不能說是10g新特性,只是10g對增備的完善,10g的增備是實際意義上的增備,速度提升明顯。不像9i如果是oltp系統增備時間往往會比全備長,10g對於增備推出了BLOCK change tracking 日誌,其實就是在日誌裡維護了一個全庫塊的點陣圖。點陣圖操作快,而且不大。就是最繁忙的庫,相對大的庫,這個BLOCK change tracking 日誌也很難到10m,所以說10g的增備相當值得應用!在資料量超過2t以後,效果更好!
引用自:http://www.itpub.net/thread-395435-1-1.html
在10g之前的版本,使用rman做增量備份,rman在做1級備份的時候怎麼來確定0級備份之後都有哪些資料塊做了修改呢?看下面一段
Each data block in a datafile contains a system change number (SCN), which is the
SCN at which the most recent change was made to the block. During an incremental
backup, RMAN reads the SCN of each data block in the input file and compares it to
the checkpoint SCN of the parent incremental backup. If the SCN in the input data
block is greater than or equal to the checkpoint SCN of the parent, then RMAN copies
the block.
也就是說在做level 1級備份的時候,需要掃描所有的資料塊並且用塊中記錄修改的SCN跟level 0備份時的SCN做比較,來確定什麼是需要備份的。
所以掃描整個資料檔案是不可避免的 !(這是10g以前的版本)
Block change tracking是Oracle10g的一個新特性,Block change tracking程式記錄自從上一次備份以來資料塊的變化,並把這些資訊記錄在跟蹤檔案中。RMAN使用這個檔案判斷增量備份中需要備份的變更資料。這極大的促進了備份效能,RMAN可以不再掃描整個檔案以查詢變更資料。
RMAN's change tracking feature for incremental backups improves incremental
backup performance by recording changed blocks in each datafile in a change tracking
file. If change tracking is enabled, RMAN uses the change tracking file to identify
changed blocks for incremental backup, thus avoiding the need to scan every block in
the datafile.
估計又是使用的點陣圖!沒找到依據呢,看書不太仔細。
讓我們來對它們的速度做一下測試,
不使用block change tracking,看看備份需要的時間
首先關閉block change tracking
> select status , filename, bytes from v$block_change_tracking;
STATUS FILENAME BYTES
---------- ---------------------------------------- ----------
DISABLED
然後讓我們來做個0級增量備份,和一個1級備份,注意它們使用的時間
RMAN> backup incremental level 0 format '/u01/level0_%U.bak' database;
Starting backup at 30-AUG-12
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=136 devtype=DISK
channel ORA_DISK_1: starting incremental level 0 datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
input datafile fno=00001 name=+DATA1/ch/datafile/system.268.792554517
input datafile fno=00003 name=+DATA1/ch/datafile/sysaux.267.792554563
input datafile fno=00005 name=+DATA1/ch/datafile/example.266.792554587
input datafile fno=00004 name=+DATA1/ch/datafile/users.265.792554603
input datafile fno=00002 name=+DATA1/ch/datafile/undotbs1.264.792554609
input datafile fno=00008 name=+DATA2/ch/datafile/test2.256.792657081
input datafile fno=00009 name=+DATA3/ch/datafile/test4.256.792658607
input datafile fno=00006 name=+DATA1/ch/datafile/test01.dbf
input datafile fno=00007 name=+DATA1/ch/datafile/test02.dbf
channel ORA_DISK_1: starting piece 1 at 30-AUG-12
channel ORA_DISK_1: finished piece 1 at 30-AUG-12
piece handle=/u01/level0_0jnjv5d8_1_1.bak tag=TAG20120830T172352 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:35
channel ORA_DISK_1: starting incremental level 0 datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
including current control file in backupset
including current SPFILE in backupset
channel ORA_DISK_1: starting piece 1 at 30-AUG-12
channel ORA_DISK_1: finished piece 1 at 30-AUG-12
piece handle=/u01/level0_0knjv5eb_1_1.bak tag=TAG20120830T172352 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:03
Finished backup at 30-AUG-12
RMAN> backup incremental level 1 format '/u01/level1_%U.bak' database;
Starting backup at 30-AUG-12
using channel ORA_DISK_1
channel ORA_DISK_1: starting incremental level 1 datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
input datafile fno=00001 name=+DATA1/ch/datafile/system.268.792554517
input datafile fno=00003 name=+DATA1/ch/datafile/sysaux.267.792554563
input datafile fno=00005 name=+DATA1/ch/datafile/example.266.792554587
input datafile fno=00004 name=+DATA1/ch/datafile/users.265.792554603
input datafile fno=00002 name=+DATA1/ch/datafile/undotbs1.264.792554609
input datafile fno=00008 name=+DATA2/ch/datafile/test2.256.792657081
input datafile fno=00009 name=+DATA3/ch/datafile/test4.256.792658607
input datafile fno=00006 name=+DATA1/ch/datafile/test01.dbf
input datafile fno=00007 name=+DATA1/ch/datafile/test02.dbf
channel ORA_DISK_1: starting piece 1 at 30-AUG-12
channel ORA_DISK_1: finished piece 1 at 30-AUG-12
piece handle=/u01/level1_0lnjv5go_1_1.bak tag=TAG20120830T172544 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:45
channel ORA_DISK_1: starting incremental level 1 datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
including current control file in backupset
including current SPFILE in backupset
channel ORA_DISK_1: starting piece 1 at 30-AUG-12
channel ORA_DISK_1: finished piece 1 at 30-AUG-12
piece handle=/u01/level1_0mnjv5i5_1_1.bak tag=TAG20120830T172544 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:03
Finished backup at 30-AUG-12
level 0備份後其實我根本就沒有對資料庫做什麼更改,level 1備份居然也使用了45秒(大部分時間是耗費在掃描變化上了)
然後讓我們把block change tracking啟用後測試一下level 1需要的時間
> alter database enable block change tracking using file '/u01/BLOCK_CHANGE_TRACE.LOG';
Database altered.
> select status , filename, bytes from v$block_change_tracking;
STATUS FILENAME BYTES
---------- ---------------------------------------- ----------
ENABLED /u01/BLOCK_CHANGE_TRACE.LOG 11599872
block change tracing啟用後對應作業系統上的ora_ctwr_
[oracle@yitai ~]$ ps -ef | grep -i ctwr
oracle 7292 1 2 17:31 ? 00:00:00 ora_ctwr_CH
oracle 7294 7260 0 17:31 pts/7 00:00:00 grep -i ctwr
先刪除原來的備份
RMAN> delete backupset ;(刪除當前為止所有的備份集)
RMAN> backup incremental level 0 format '/u01/level0_%U.bak' database;
Starting backup at 30-AUG-12
using channel ORA_DISK_1
channel ORA_DISK_1: starting incremental level 0 datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
input datafile fno=00001 name=+DATA1/ch/datafile/system.268.792554517
input datafile fno=00003 name=+DATA1/ch/datafile/sysaux.267.792554563
input datafile fno=00005 name=+DATA1/ch/datafile/example.266.792554587
input datafile fno=00004 name=+DATA1/ch/datafile/users.265.792554603
input datafile fno=00002 name=+DATA1/ch/datafile/undotbs1.264.792554609
input datafile fno=00008 name=+DATA2/ch/datafile/test2.256.792657081
input datafile fno=00009 name=+DATA3/ch/datafile/test4.256.792658607
input datafile fno=00006 name=+DATA1/ch/datafile/test01.dbf
input datafile fno=00007 name=+DATA1/ch/datafile/test02.dbf
channel ORA_DISK_1: starting piece 1 at 30-AUG-12
channel ORA_DISK_1: finished piece 1 at 30-AUG-12
piece handle=/u01/level0_0nnjv5vn_1_1.bak tag=TAG20120830T173343 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:01:05
channel ORA_DISK_1: starting incremental level 0 datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
including current control file in backupset
including current SPFILE in backupset
channel ORA_DISK_1: starting piece 1 at 30-AUG-12
channel ORA_DISK_1: finished piece 1 at 30-AUG-12
piece handle=/u01/level0_0onjv61o_1_1.bak tag=TAG20120830T173343 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:03
Finished backup at 30-AUG-12
RMAN> backup incremental level 1 format '/u01/level1_%U.bak' database;
Starting backup at 30-AUG-12
using channel ORA_DISK_1
channel ORA_DISK_1: starting incremental level 1 datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
input datafile fno=00001 name=+DATA1/ch/datafile/system.268.792554517
input datafile fno=00003 name=+DATA1/ch/datafile/sysaux.267.792554563
input datafile fno=00005 name=+DATA1/ch/datafile/example.266.792554587
input datafile fno=00004 name=+DATA1/ch/datafile/users.265.792554603
input datafile fno=00002 name=+DATA1/ch/datafile/undotbs1.264.792554609
input datafile fno=00008 name=+DATA2/ch/datafile/test2.256.792657081
input datafile fno=00009 name=+DATA3/ch/datafile/test4.256.792658607
input datafile fno=00006 name=+DATA1/ch/datafile/test01.dbf
input datafile fno=00007 name=+DATA1/ch/datafile/test02.dbf
channel ORA_DISK_1: starting piece 1 at 30-AUG-12
channel ORA_DISK_1: finished piece 1 at 30-AUG-12
piece handle=/u01/level1_0pnjv628_1_1.bak tag=TAG20120830T173503 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
channel ORA_DISK_1: starting incremental level 1 datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
including current control file in backupset
including current SPFILE in backupset
channel ORA_DISK_1: starting piece 1 at 30-AUG-12
channel ORA_DISK_1: finished piece 1 at 30-AUG-12
piece handle=/u01/level1_0qnjv629_1_1.bak tag=TAG20120830T173503 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:03
Finished backup at 30-AUG-12
顯然level 1備份用了1秒就完成了,比起沒有啟用block change tracking快了幾十倍
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/27042095/viewspace-742397/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Oracle RMAN 增量備份優化方法(啟用 Block Change Tracking特性)Oracle優化BloC
- oracle 10g中使用block change tracking加快增量備份Oracle 10gBloC
- 適用於rman增級備份之資料庫特性db block change tracking學習思路資料庫BloC
- oracle 的 BLOCK CHANGE TRACKINGOracleBloC
- 啟用Block Change Tracking-10g新特性BloC
- Oracle Block Change Tracking功能OracleBloC
- ZT 啟用Block Change Tracking-10g新特性BloC
- 啟用oracle block change trackingOracleBloC
- 10g中的塊修改跟蹤特性(Block Change Tracking)BloC
- Oracle RMAN 增量備份Oracle
- oracle 10g R2 Block change tracking 新特性Oracle 10gBloC
- rman備份和增量備份指令碼指令碼
- rman增量備份指令碼指令碼
- Oracle 11g RMAN備份-增量備份Oracle
- RMAN說,我能備份(9)--RMAN增量備份與備份保留策略
- Block Change Tracking (Oracle 塊修改跟蹤)BloCOracle
- rman備份的其它特性
- XTTS全備開啟BCT後等待事件 block change tracking buffer spaceTTS事件BloC
- Backup And Recovery User's Guide-RMAN備份概念-增量備份-累積增量備份GUIIDE
- Backup And Recovery User's Guide-RMAN備份概念-增量備份-差異增量備份GUIIDE
- Backup And Recovery User's Guide-RMAN備份概念-增量備份-多級增量備份GUIIDE
- Oracle10g新增BLOCK CHANGE TRACKING功能OracleBloC
- oracle 10g 開啟BLOCK CHANGE TRACKINGOracle 10gBloC
- Oracle OCP 1Z0 O53 Q78(RMAN block change tracking)OracleBloC
- SQL SERVER BACKUP DATABASE 加快備份速度方法SQLServerDatabase
- 熱備份與RMAN備份中split block的處理BloC
- Backup And Recovery User's Guide-RMAN備份概念-增量備份-增量備份演算法GUIIDE演算法
- 【RMAN】使用增量備份更新資料庫備份映象資料庫
- oracle聯機熱備份的原理,及rman增量備份原理Oracle
- Oracle聯機熱備份的原理及rman增量備份原理Oracle
- Backup And Recovery User's Guide-RMAN備份概念-增量備份-累積增量備份-練習GUIIDE
- Oracle 塊修改跟蹤 (Block Change Tracking) 說明OracleBloC
- 【RMAN】RMAN備份恢復3 RMAN增量備份指令碼與crontab計劃任務指令碼
- oracle聯機熱備份的原理及rman增量備份原理(zt)Oracle
- oracle10g RMAN增量備份策略Oracle
- Nocatalog 下的RMAN 增量備份 shell指令碼指令碼
- 一個較完整的RMAN增量備份指令碼指令碼
- RMAN關於物理檔案copy的增量備份