Sharing My Database Experience

Menu

How to enable/disable block tracking for RMAN?

Using block tracking one can improve performance of the backup time of incremental backup from hours to minutes depending on size of database as it no longer needs to scan blocks in datafiles to find blocks changed it can use the block tracking file to identify changed blocks for incremental backup. Enabling this starts a new background process called Change Tracking Writer (CTWR) which manages this file.

Here are the steps to enable block tracking:
— Note if the file already exists the command will fail unless the REUSE option is used so first check if block tracking is not enabled before overwriting the file.

— if it returns DISABLED it means block tracking is off
SQL> SELECT distinct status from V$BLOCK_CHANGE_TRACKING;

After block tracking file is created you would need to do level 0 backup to ensure the next incremental backup uses the block tracking file.

RMAN> BACKUP INCREMENTAL LEVEL 0 DATABASE;

The subsequent incremental backup (differential/cumulative) would use the block change tracking file to identify the changes that need to be backed up.
— For differential incremental backup, this will backup blocks since last last level 0 or level 1 which ever is latter.
RMAN> BACKUP INCREMENTAL LEVEL 1 DATABASE;

Shows the process that are using the file, and when RMAN is running it will have handles on the file when running incremental backup.
$ fuser /u04/oradata/TEST/rman_block_tracking.f
/u04/oradata/TEST/rman_block_tracking.f: 9597302
oracle 9597302 1 0 13:29:41 – 0:31 ora_ctwr_TEST