Thursday 30 August 2018

Oracle RMAN Incremental Backups


RMAN Incremental Backups (Level 0 & Level 1)


Since taking Full backups consumes lots of space and also takes much time, many dba's resorts to incremental backup. The advantage of incremental backups compare to Full backup is that it takes less time and also consumes less space.
The main idea of incremental backups is that not all tables are changed daily. So why take full backup daily it's sufficient to just take backup of changes rather than whole database.
An Incremental Backup copies only those blocks changed since last incremental or full backup. The incremental backup takes less time and occupies less space then a normal full database backup.
The incremental backups in RMAN is much robust than incremental Export of database using Oracle Export tool. The incremental export of database copies all the tables changed since last complete export. So even if one row in a big table containing millions of rows is changed then the whole table is considered as changed and export tool will export the whole table while taking incremental export.
Whereas if you are taking an incremental backup using RMAN then if one row is changed in a big table then RMAN will copy only the changed block containing the changed row instead of copying the whole table blocks.
So the RMAN incremental backups are much more efficient and also takes less time and occupies less space then incremental export of database
The increment backup in RMAN is done if you specify a LEVEL <n> option, where n can by either 0 or 1
LEVEL 0 incremental backup means complete backup just like Full backup
LEVEL 1 incremental backup copies all blocks changed since last LEVEL 0 or LEVEL 1 backup.
LEVEL 1 COMULATIVE backup copies all blocks changed since last LEVEL 0 backup.
In incremental backup strategy you will first need to take complete backup i.e. LEVEL 0 backup
oracle incremental backups
In the above picture, we are taking complete backup on Monday and then on each other day of the week we are taking incremental backup. If we lose the database on Friday in the first week, the database have to recovered first from complete backup taken on first Monday and then we have to apply the incremental backups taken on Tue, Wed and Thursday.
Similarly if the database is lost on Wednesday in the second week, we have to recover database first from Monday in the second week and then we have to apply incremental backups on Tuesday.

Let's take complete Backup LEVEL 0 backup
Type the following command at RMAN prompt
RMAN> backup incremental level 0 database;
backup incremental complete backup
The above backup can now be considered as base backup or parent backup.
Next day we can take incremental level 1 backup which will copy only the changes made since last backup
To make incremental level 1 backup give the following command
RMAN> backup incremental level 1 database;
incremental level1 backup rman
Similarly you can also take cumulative backup by typing the following command
RMAN> backup incremental level 1 cumulative database;
oracle incremental cumulative backup
You can also take incremental backup of particular tablespaces.
To take incremental backup of users tablespaces we can give the following command
RMAN> backup incremental level 1 tablespace users;
backup incremental tablespace

No comments:

Post a Comment