日期:2014-05-16  浏览次数:20558 次

Oracle 块修改跟踪 (Block Change Tracking) 说明

Block ChangeTracking 是Oracle 10g里推出的特性。官网对Block change tracking 的定义如下:

?????? Adatabase option that causes Oracle to track data file blocks affected by eachdatabase update. The tracking information is stored in a block change trackingfile. When block change tracking is enabled, RMAN uses the record of changedblocks from the change tracking file to improve incremental backup performanceby only reading those blocks known to have changed, instead of reading datafiles in their entirety.

?????? --Block change tracking 会记录data file里每个block的update 信息,这些tracking信息保存在tracking 文件里。 当启动block change tracking 后,RMAN 使用trackingfile里的信息,只读取改变的block信息,而不用在对整个data file进行扫描,从而提高了RMAN 备份的性能。

??????

11gR2 文档里的说明。

http://download.oracle.com/docs/cd/E11882_01/backup.112/e10642/rcmbckba.htm#BRADV8125

?

一.About Block Change Tracking

If block changetracking is enabled on a primary or standby database, then RMAN uses a?blockchange tracking file?to identify changed blocks for incrementalbackups. By reading this small bitmap file to determine which blocks changed,RMAN avoids having to scan every block in the data file that it is backing up.

--block change tracking file 是bitmap file。

?

Block changetracking is disabled by default. Nevertheless, the benefits of avoiding fulldata file scans during backup are considerable, especially if only a smallpercentage of data blocks are changed between backups. If your backup strategyinvolves incremental backups, then block change tracking is recommended. Blockchange tracking does not change the commands used to perform incrementalbackups. The change tracking file requires no maintenance after initialconfiguration.

--Block change tracking 默认是禁用的,如果启用了incrementalbackup,那么建议开启block change tracking。 启用BCT后,不需要其他的维护操作。

?

You can only enable block change tracking at a physical standby database if a license forthe Oracle Active Data Guard option is enabled.

?

1.1 SpaceManagement in the Block Change Tracking File

The change tracking file maintains bitmaps that mark changes in the datafiles betweenbackups. The database performs a bitmap switch before each backup. OracleDatabase automatically manages space in the change tracking file to retainblock change data that covers the eight most recent backups. After the maximumof eight bitmaps is reached, the oldest bitmap is overwritten by the bitmapthat tracks the current changes.

--在备份期间,change tracking会维护已经标记为change 的block 的bitmap 信息。Oracle 会自动管理change tracking file的大小,只保留最近最近8次blockchange 的信息。 超过8次, 那么最前面的block bitmap 信息会被current change 覆盖。

?

The first level0 incremental backup scans the entire data file. Subsequent incremental backupsuse the block change tracking file to scan only the blocks that have beenmarked as changed since the last backup. An incremental backup can be optimizedonly when it is based on a parent backup that was made after the start of theoldest bitmap in the block change tracking file.

--第一个0级的增量备份扫描整个datafile。 随后的增量备份使用block changetracking file的信息,只扫描自上次备份以来被标记为change 的block。

?

Consider theeight-bitmap limit when developing your incremental backup strategy. Forexample, if you make a level 0 database backup followed by seven differentialincremental backups, the