Monday, 28 May 2018

RMAN Block Change Tracking and it's Limitations - Oracle Database

What is Block Change Tracking and How to enable it?


What is Block Change Tracking? How to Configure Block Change Tracking? Limitations of the information provided in Block Change Tracking

Block Change Tracking


Block Change Tracking is the mechanism of keeping the track of Data Block changes happening inside a database. Once ENABLED, it helps in improving the incremental backup performance. The Block Change information is stored inside a FILE which keeps tracks of the changes made to the DATA BLOCKS so that instead of scanning all DATA BLOCKS, Oracle (RMAN) can simply read the info from this FILE and proceed with its work.

How to Configure Block Change Tracking?


Please follow the below mentioned steps if you wish to configured Block Change Tracking within your Oracle Database.

1) Check for current Block Change Tracking Status.

Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options

SQL> desc V$BLOCK_CHANGE_TRACKING;
 Name    Null?    Type
 ----------------------------------------- -------- ----------------------------
 STATUS     VARCHAR2(10)
 FILENAME     VARCHAR2(513)
 BYTES     NUMBER
 CON_ID     NUMBER

SQL> set lines 100 pages 500
SQL> col FILENAME for a40;
SQL> select STATUS, FILENAME, BYTES/1024/1024 from V$BLOCK_CHANGE_TRACKING;

STATUS    FILENAME     BYTES/1024/1024
---------- ---------------------------------------- ---------------
DISABLED

SQL>

2) You can Start the Block Change Tracking at Database MOUNT or OPEN state. Since I have it DISABLED at the moment. Let's connect to RMAN to ENABLE the same.

[oracle@practice ~]$ rman target /

Recovery Manager: Release 12.1.0.2.0 - Production on Mon May 28 20:33:42 2018

Copyright (c) 1982, 2014, Oracle and/or its affiliates.  All rights reserved.

connected to target database: ORADB12C (DBID=3836283445)

RMAN> select name from V$DATAFILE;

using target database control file instead of recovery catalog

NAME                                                                         
--------------------------------------------------------------------------------
/u01/app/oracle/oradata/oradb12c/system01.dbf
/u01/app/oracle/oradata/oradb12c/sysaux01.dbf
/u01/app/oracle/oradata/oradb12c/undotbs01.dbf
/u01/app/oracle/oradata/oradb12c/example01.dbf
/u01/app/oracle/oradata/oradb12c/users01.dbf

RMAN> alter system set DB_CREATE_FILE_DEST='/u01/app/oracle/oradata/';

Statement processed

RMAN> alter database ENABLE block change tracking;

Statement processed

Note: When you modify DB_CREATE_FILE_DEST parameter, it configures the default path for a database to add a new DB file. That means after you define this parameter, the new database files will be added to this path by default. Also the BLOCK CHANGE TRACKING FILE will be created in the defined path only. You don't need to specify the directory named as SID as it will be automatically created.

3) Verify the creation of Block Change Tracking File now,

SQL> select STATUS, FILENAME, BYTES/1024/1024 from V$BLOCK_CHANGE_TRACKING;

STATUS    FILENAME     BYTES/1024/1024
---------- ---------------------------------------- ---------------
ENABLED    /u01/app/oracle/oradata/ORADB12C/changet     11.0625
   racking/o1_mf_fjr6qv4q_.chg

Limitations of Block Change Tracking


The change tracking file maintains bitmaps that show us the change in the Data Blocks between backups. Now a Block Change Tracking file can hold information for maximum 8 bitmaps and once the change for 8 bitmaps has been recorded, it again starts from the 1st bitmap and overwrites the same for the next change record. That's a big problem. For example,

If you have taken a Incremental Level 0 Backup at the beginning and it is followed by 7 incremental Level 1 backups, then you must go for an incremental Level 0 again or if you go for any other Incremental Level 1 (Differential/Cummulative) then it will overwrite the Level 0 bitmap change record resulting in RMAN Backup optimization failure.

I Hope this helps !!

No comments:

Post a comment