Massive RMAN Script for Tape Backups

run {
allocate channel sbt1 type sbt parms ‘ENV=(TDPO_OPTFILE=/opt/tivoli/tsm/client/oracle/bin64/tdpo.opt)’;
allocate channel sbt2 type sbt parms ‘ENV=(TDPO_OPTFILE=/opt/tivoli/tsm/client/oracle/bin64/tdpo.opt)’;
CONFIGURE CONTROLFILE AUTOBACKUP ON;
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO ‘/u03/rmanbkp/orcl/autobackup_control_file_%F’;
CONFIGURE DEFAULT DEVICE TYPE TO ‘SBT_TAPE’;

BACKUP AS COMPRESSED BACKUPSET DATABASE FORMAT ‘PRIME_FULL_%s_%D_%M_%Y’ tag ‘ORCL_DAILY_FULL_DB_BKP’;
BACKUP AS COMPRESSED BACKUPSET archivelog all not backed up 1 times format ‘ARCH_%d_ALL_%s_%t’ tag ‘ORCL_ARCH_LOG_BKP’;
BACKUP AS COMPRESSED BACKUPSET CURRENT CONTROLFILE FORMAT ‘control_file_%d_%a_%T_%s_%p’ tag ‘ORCL_CONTROL_BKP’;

delete noprompt archivelog all completed before ‘sysdate-7’;
CROSSCHECK ARCHIVELOG ALL;
DELETE NOPROMPT EXPIRED ARCHIVELOG ALL;
crosscheck backupset;
crosscheck backup;
delete noprompt expired backup;
delete noprompt obsolete;
resync catalog;
release channel sbt1;
release channel sbt2;
}

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