Rman Merged backup

Rman merged backup script for windows environment:

Rman Merged Backup Script works as for both level 1 backup merged with level 0 backup.

Level 0 Backup is full backup of database

Level 1 is incremental backup after level 0.

Merged level 1 backup merged backup with level 0 backup files. It update old level 0 files backup and merge with them.

Following command is used at Enterprise edition to enable the block change tracking for level 1 incremental backup. Its not supported in Standard Editions

It will track all the record updated after level 0 backup so that it fasten the process of rman level 1 backup

ALTER DATABASE ENABLE BLOCK CHANGE TRACKING USING FILE 'C:\blockchangetracking.dbf' REUSE;

Level 0 Backup Script

run {
CONFIGURE RETENTION POLICY TO REDUNDANCY 10;
CONFIGURE BACKUP OPTIMIZATION ON;
CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT 'C:\RMAN\Db_df%t_s%s_s%p';
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO 'c:\rman\ctrl_%F';
CONFIGURE DEVICE TYPE DISK BACKUP TYPE TO COMPRESSED BACKUPSET PARALLELISM 2;
allocate channel c1 device type disk ;
allocate channel c2 device type disk ;
BACKUP INCREMENTAL LEVEL 0 DATABASE format 'C:\RMAN\%d_%s_%T_%c_DB0' TAG="DB_LEV0";
BACKUP ARCHIVELOG ALL format 'C:\RMAN\%d_%s_%T_%c_ARCH0' tag "ARCH_LEV0";
backup current controlfile format 'C:\RMAN\%d_%s_%T_%c_ARCH0%d_%s_%T_CONTROL' tag "CNTRLFL";
backup spfile format 'C:\RMAN\%d_%s_%T_%c_ARCH0%d_%s_%T_SPFILE' tag "SPFILE" ;
}

Level 1 Backup

run {
allocate channel c1 device type disk ;
allocate channel c2 device type disk ;
BACKUP INCREMENTAL LEVEL 1 FOR RECOVER OF COPY WITH TAG DB_LEV0 DATABASE;
RECOVER COPY OF DATABASE WITH TAG DB_LEV0;
BACKUP ARCHIVELOG ALL format 'C:\RMAN\%d_%s_%T_%c_ARCH0' tag "ARCH_LEV1";
backup current controlfile format 'C:\RMAN\%d_%s_%T_CONTROL' tag "CNTRLFL" ;
backup spfile format 'C:\RMAN\%d_%s_%T_SPFILE' tag "SPFILE" ;
}

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s