Sooner or later with a permanent growing database we will end up in a situation that our night isn’t just long enough anymore to backup our database completely.
Now you might wonder about what size of database I’m talking about right now. But seriously, database at a size of several terrabyte are nothing uncommon today anymore. Especially when it comes to SAP or similar applications working on them databases can grow exceptional sizes..
The Oracle Database Version 10g now comes along with some new feature helping us to deal with that situation. It is a feature called Block Change Tracking and marks down all modified database blocks changed by all transactions within an additional external file.
When a commit is issued against a data block, the block change tracking information is copied to a shared area in Large Pool called the CTWR buffer and during the next checkpoint, the CTWR process writes down the information from the CTWR RAM buffer to the former defined change-tracking file.
Now doing an incremental backup with Oracle 10g, RMAN has a mechanism to identify and bypass those data blocks which have not changed by just easily following the list of changed blocks within this file.
The syntax for Oracle block level change tracking is simple:
ALTER DATABASE
ENABLE BLOCK CHANGE TRACKING
USING FILE os_file_name;
By default, Oracle does not record block change information!
To enable this feature, we need to issue the following command:
SQL> alter database enable block change tracking;
To disable this feature, we issue this command:
SQL> alter database disable block change tracking;
So it’s an absolutely easy to configure mechanism, being able to speed up our nightly incremental backups dramatically. Leaving the full backups for the weekends, customers then hopefully don’t mind.
The only thing we have to be aware about is the space this file later on will need to get written. Based on our databases transaction load this change-tracking file can reach some serious size for sure.