Join this Blog for direct reference of any post into your inbox. To join just click on "Join this Site" under "Follower" then Login with your Email.*** DECLARATION: I Maintain this Blog for Helping Myself While at Work and Welcome any body Needing Help!!!.*** CAUTION: Using any of the script from this Blog may contain at Own Risk. These scripts May or May not have been Tested.***

Monday, 2 December 2013

Block Change Tracking

RMAN incremental backup backups only the blocks that were changed since the latest base incremental backups. But RMAN had to scan whole database to find the changed block. Hence the incremental backup reads the whole database and writes only the changed blocks. Thus the RMAN incremental backup saves space but no more reduction in backup time.
Block tracking is a new feature in oracle 10g which enables RMAN to reads only the changed blocks and to writes only the changed blocks.
During the incremental backup, oracle scans the whole data file and compare the SCN between the blocks in the data file and backup set files (If the block’s SCN is greater than the SCN in the base backup then that block is taken into consideration for new incremental backup). Usually only few blocks changed between backups and the RMAN has to do unnecessary work for reading the whole database. It will be a time consuming tasks.
Oracle introduced change tracking file to track the physical location of all database changes. During an incremental backup, RMAN uses the change tracking file to quickly identify only the blocks that have changed, avoiding the time consuming task of reading the entire data file to determine which blocks have changed.
To enable/disable block change tracking:
SQL> Alter Database Enable Block Change Tracking;
SQL> Alter database enable block change tracking using file ‘D:/change_tracking/chg01.dbf’;
SQL> Alter Database Disable Block Change Tracking;
The new background process that does this logging is Change Tracking Writer (CWTR). The view V$BLOCK_CHANGE_TRACKING and V$BACKUP_DATAFILE can be useful shows where block change tacking file is stored, whether it is enabled, and how large it is and BCT is used or not.

SQL> Select Completion_time, datafile_blocks, blocks_read, blocks, used_change_tracking
From v$backup_datafile
where to_char(completion_time, 'dd/mon/yy') = to_char(sysdate, 'dd/mon/yy');


Post a Comment