Fast Incremental Backups with Block Change Tracking

November 24, 2008  |  dba, security

Backing up terabyte size databases can be time consuming. When RMAN performs an incremental backup, Oracle must scan all database / tablespace to identify which blocks have been updated since last backup. This, of course, is very time and resource consuming. Fortunatly Oracle 10g brings the possibility to track changed blocks using a change tracking file. Enabling database change tracking adds a small overhead, but it largely improves the performance of incremental backups.

In the next sample code I’ll check the current change tracking status, alter database do enable this feature and add a file to record the changed database blocks

SELECT status FROM v$block_change_tracking;

ALTER DATABASE ENABLE BLOCK CHANGE TRACKING;

ALTER DATABASE ENABLE BLOCK CHANGE TRACKING
USING FILE '/u01/oradata/mydb/rman_change_tracking.ora' REUSE;

After this, when block is changed in the database, Oracle will record the fact in the rman_change_tracking.ora file. During incremental backup, RMAN checks this file to see which blocks need the backup instead of checking all the blocks of a tablespace / database. This dramatically reduces CPU cycles and speeds up incremental backup in the process.

Our tracking file will start with 10MB and grows in 10MB increments.

Block Change tracking can be disabled at any time with:

ALTER DATABASE DISABLE BLOCK CHANGE TRACKING;

We can also rename or move the tracking file at any time issuing the command ALTER DATABASE RENAME FILE.

By reducing the backup time we can achieve the following objectives too:

  • Increase the frequency of incremental backups
  • Reduce recovery time and mean time to recover


Leave a Reply