CTWR (Change Tracking Writer) :-
- CTWR (Change Tracking Writer) is the background process responsible for tracking the blocks.
- CTWR will be useful in RMAN. Optimized incremental backups using block change tracking (faster incremental backups) using a file (named block change tracking file).
- CTWR process is to write the changed block information in BCT file.
Block Change Tracking (file):-
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.
Change tracking is disabled by default, because it introduces some minimal performance overhead on database during normal operations. However, the benefits of avoiding full datafile scans during backup are considerable, especially if only a small percentage of data blocks are changed between backups. If backup strategy involves incremental backups, then we should enable change tracking.
One change tracking file is created for the whole database. By default, the change tracking file is created as an Oracle managed file in DB_CREATE_FILE_DEST. We can also specify the name of the block change tracking file, placing it in any desired location.
Using change tracking in no way changes the commands used to perform incremental backups, and the change tracking files themselves generally require little maintenance after initial configuration.
From Oracle 10g, the background process Block Change Tracking Writer (CTWR) will do the job of writing modified block details to block change tracking file.
In a Real Applications Clusters (RAC) environment, the change tracking file must be located on shared storage accessible from all nodes in the cluster.
Oracle saves enough change-tracking information to enable incremental backups to be taken using any of the 8 most recent incremental backups as its parent.
Although RMAN does not support backup and recovery of the change-tracking file itself, if the whole database or a subset needs to be restored and recovered, then recovery has no user-visible effect on change tracking. After the restore and recovery, the change tracking file is cleared, and starts recording block changes again. The next incremental backup after any recovery is able to use change-tracking data.After enabling change tracking, the first level 0 incremental backup still has to scan the entire datafile, as the change tracking file does not yet reflect the status of the blocks. Subsequent incremental backup that use this level 0 as parent will take advantage of the change tracking file.
You can view the size of the CTWR dba buffer by looking at v$sgastat:
SQL> SELECT * FROM v$sgastat WHERE name like ‘CTWR%’; POOL NAME BYTES -------- ------------- ------- large pool CTWR dba buffer 1220000
Enable Block Change Tracking:-
SQL> show parameter db_create_file_dest NAME TYPE VALUE ---------------- ----- ----- db_create_file_dest string SQL> alter system set db_create_file_dest='/home/oracle/app/oracle' scope=both; System altered. SQL> ALTER DATABASE ENABLE BLOCK CHANGE TRACKING; System altered. select filename, status, bytes from v$block_change_tracking STATUS FILE BYTES ----------- -------------------------------------- -------------- ENABLED /home/oracle/app/oracle/01_mf_nsrv.chg 10,000,000
Manually specify location for BCT :
SQL> ALTER DATABASE ENABLE BLOCK CHANGE TRACKING USING FILE ‘/home/oracle/app/oracle/block_change_tracking.dbf’;
The REUSE option tells Oracle to overwrite any existing file with the specified name.
SQL> ALTER DATABASE ENABLE BLOCK CHANGE TRACKING USING FILE ‘/home/oracle/app/oracle/block_change_tracking.dbf’ REUSE;
Disable Block Change Tracking:-
SQL> ALTER DATABASE DISABLE BLOCK CHANGE TRACKING; SQL> select * from V$BLOCK_CHANGE_TRACKING; STATUS FILE BYTES ----------- -------------------------------------- -------------- DISABLED /home/oracle/app/oracle/ 10,000,000 block_change_tracking.dbf
Catch Me On:- Hariprasath Rajaram Telegram:https://t.me/joinchat/I_f4DkeGfZuxgMIoJSpQZg LinkedIn:https://www.linkedin.com/in/hariprasathdba Facebook:https://www.facebook.com/HariPrasathdba FB Group:https://www.facebook.com/groups/894402327369506/ FB Page: https://www.facebook.com/dbahariprasath/? Twitter: https://twitter.com/hariprasathdba