Incrementally updating backup copy for fast recovery

«« Previous
Next »»

Incrementally Updating Backups


RMAN also lets you incrementally update a database backup with the changes instead of creating a separate incremental backup each time. The advantage of updating a database backup is that it will take less time to recover.

To incrementally update data file backups:

1. First we need to create a full image copy backup of the database with a specified tag.
2. At regular intervals, make a level 1 incremental backup of database with the same tag.
3. Apply the incremental backup to the most recent backup with the same tag.

Example

RUN
{
  RECOVER COPY OF DATABASE WITH TAG 'updated_db_bck';
  BACKUP
    INCREMENTAL LEVEL 1
    FOR RECOVER OF COPY WITH TAG 'updated_db_bck'
    DATABASE;
}

You can run the script daily and RMAN will automatically

1st Run
Creates a complete backup

2nd Run
Takes incremental backup

3rd Run and so on
Takes a incremental backup and updates the complete backup with it

Block Change Tracking for faster Incremental Backups


When you take RMAN incremental backups RMAN has to scan each block in datafiles to determine whether it has changed or not, this takes quite a time. This time can be reduced by enabling block change tracking

When you enable block change tracking then Oracle will create a Block Change Tracking File in which Oracle will maintain the status of blocks whether it is changed or not. So that when you take RMAN incremental backup, RMAN will scan this file instead of whole datafile to determine which blocks are changed. This makes incremental backups faster.

Enabling Block Change Tracking

To Enable Block Change Tracking give the following command when the database is in opened or mounted state

SQL> ALTER DATABASE ENABLE BLOCK CHANGE TRACKING;

The Block Change Tracking File by default is located in the directory mentioned in DB_CREATE_FILE_DEST parameter.

If you want to have the file in another location then you can mention the location by typing the following command

SQL> ALTER DATABASE ENABLE BLOCK CHANGE TRACKING
  USING FILE '/u02/oracle/test/block_chg_file/test_db_block_change_track.f' REUSE;

Disabling Block Change Tracking

SQL> ALTER DATABASE DISABLE BLOCK CHANGE TRACKING;

To Know the Status of Block Change Tracking

SQL> SELECT STATUS, FILENAME FROM V$BLOCK_CHANGE_TRACKING;

«« Previous
Next »»

0 comments:

Post a Comment