Oracle Block Change Tracking
Version 21c

General Information
Library Note Morgan's Library Page Header
ACE Director Alum Daniel Morgan, founder of Morgan's Library, is scheduling complimentary technical Workshops on Database Security for the first 30 Oracle Database customers located anywhere in North America, EMEA, LATAM, or APAC that send an email to asra_us@oracle.com. Request a Workshop for your organization today.
Note: Once enabled; this new 10g feature records the modified since last backup and stores the log of it in a block change tracking file using the CTW (Change Tracking Writer) process. During backups RMAN uses the log file to identify the specific blocks that must be backed up. This improves RMAN's performance as it does not have to scan whole datafiles to detect changed blocks. Logging of changed blocks is performed by the CTRW process which is also responsible for writing data to the block change tracking file.

You can only enable block change tracking at a physical standby database if a license for the Oracle Active Data Guard option has been purchased and this option is enabled. To enable Active Data Guard on a standby database, set the ENABLE_OPTION_ACTIVE_DATA_GUARD initialization parameter to TRUE. If a license for the Data Guard option has not been purchased, the ENABLE_OPTION_ACTIVE_DATA_GUARD initialization parameter should be set to FALSE. The open standby database will be closed, if recovery is started, and the following message is displayed in the alert log: You have note enabled the Active Data Guard option by setting ENABLE_OPTION_ACTIVE_DATA_GUARD to TRUE. The standby database will be closed before starting recover.
 
DISABLE
Disable block change tracking ALTER DATABASE DISABLE BLOCK CHANGE TRACKING;
conn / as sysdba

SELECT filename, status, bytes
FROM v$block_change_tracking;

ALTER DATABASE DISABLE BLOCK CHANGE TRACKING;

SELECT filename, status, bytes
FROM v$block_change_tracking;

SELECT *
FROM gv$sgastat
WHERE name LIKE '%CTWR%';

SELECT inst_id, sid, program, status
FROM gv$session
WHERE program LIKE '%CTWR%';
 
ENABLE
Enable block change tracking ALTER DATABASE ENABLE BLOCK CHANGE TRACKING [USING FILE <file_path_and_name>] [REUSE];
conn / as sysdba

SQL> col filename format a60

SQL> SELECT filename, status, bytes
  2  FROM v$block_change_tracking;

FILENAME                                               STATUS     BYTES
------------------------------------------------------ ---------- ----------
                                                       DISABLED

SQL> ALTER DATABASE ENABLE BLOCK CHANGE TRACKING
  2  USING FILE '/u01/app/oracle/fast_recovery_area/ORABASE/bctf01.log';

Database altered.

SQL> SELECT filename, status, bytes
  2  FROM v$block_change_tracking;

FILENAME                                               STATUS         BYTES
------------------------------------------------------ ---------- ---------
/u01/app/oracle/fast_recovery_area/ORABASE/bctf01.log  ENABLED     11599872

SQL> SELECT *
  2  FROM gv$sgastat
  3  WHERE name LIKE '%CTWR%';

 INST_ID   POOL           NAME               BYTES   CON_ID
---------- -------------- ---------------- -------- -------
         1 large pool     CTWR dba buffer   1015808       1

SQL> SELECT inst_id, sid, program, status
  2  FROM gv$session
  3  WHERE program LIKE '%CTWR%';

 INST_ID  SID PROGRAM                   STATUS
-------- ---- ------------------------- -------
       1  189 oracle@db18c-ee-hp (CTWR) ACTIVE

Related Topics
Backup Restore and Recover
Built-in Functions
Built-in Packages
CTWR Process
RMAN
RMAN Demos
What's New In 21c
What's New In 23c

Morgan's Library Page Footer
This site is maintained by Dan Morgan. Last Updated: This site is protected by copyright and trademark laws under U.S. and International law. © 1998-2023 Daniel A. Morgan All Rights Reserved
  DBSecWorx