Total Pageviews

Monday 3 September 2012

Reducing RMAN Incremental Backup Time (CTWR:Change tracking writer)

Implement RMAN's block change tracking feature to reduce the time it takes to make an RMAN incremental backup.
Use the following commands to create a change tracking file in the specified location .If you leave out the location ,RMAN creates the block change tracking file in the location specified by the db_create_file_dest initialization parameter:
  • Alter system set db_create_file_dest='/u01/app/oracle/dfiles' scope=both;
  • Alter database enable block change tracking;
If you want , you can create the block changing file in a location you specify, as shown below:
  • Alter database enable block change tracking using file '/u01/app/oracle/dfiles/change_track.txt';
View V$BLOCK_CHANGE_TRACKING shows whether change tracking is enabled and other details of the change tracking file.

How block change tracking works:

RMAN uses a binary file refereed as block change tracking file to record the changed blocks in each datafile in the database .When you perform an incremental backup,RMAN refers to this change tracking file instead of scanning all the data blocks in all the data-files in the database,thus making the incremental backup finish faster.

How to move the change tracking file to a different location:
  • Determine the current location of the block change tracking file using: Select filename from  v$block_change_tracking;
  • Shutdown the database  SQL> Shu immediate
  • Move the file to the new location using the operating system command: $ mv /u01/app/oracle/dfiles/change_trac.txt   /u01/app/newdestination/change_track.txt
  • 4.Start up the database in mount  SQL>startup mount;
  • 5.Use the alter database rename command: Alter database rename file ' /u01/app/oracle/dfiles/change_trac.txt'  to  ' /u01/app/newdestination/change_track.txt'
  • 6.Open the database SQL> Alter database open;
If you can't shutdown the database for some reasons,you have to first change tracking and then re-enable it after you rename the change tracking file as shown below:
  • Alter database disable block change tracking
  • Alter database enable block change tracking using file '/u10/app/newdestination/change_track.txt'
As a result of directing output to the new file without shutting down the database,you will lose the contents of the original change tracking file.

Size of the change tracking file:

The size of the change tracking file is not proportional to the number of updates in the database.Instead the size of the file depends on how large the database is,the number of data-files and how many threads of redo are enabled.Initially the file starts with a size of 10MB and grows in 10MB increments.Since RMAN allocates 320KB space in the change tracking file per datafile, a database with very large number of datafiles would require a large allocation of space for the change tracking file than a database with a smaller number of datafiles





 

No comments:

Post a Comment