Thursday, November 28, 2013

RMAN backup script

Script for RMAN backup :

rman target /

run {
 allocate channel d1 type disk;
 allocate channel d2 type disk;
 allocate channel d3 type disk;
 allocate channel d4 type disk;
 allocate channel d5 type disk;
 allocate channel d6 type disk;
 allocate channel d7 type disk;
 allocate channel d8 type disk;
 allocate channel d9 type disk;
 allocate channel d10 type disk;
BACKUP as compressed backupset FULL FILESPERSET 10 FORMAT '/_bk_%s_%p_%t.bak' DATABASE;
BACKUP as compressed backupset filesperset 10 FORMAT '/_arch_%s_%p_%t.bak' ARCHIVELOG ALL skip inaccessible;
BACKUP FORMAT '/_cntrl_%s_%p_%t.bak' CURRENT CONTROLFILE;
BACKUP FORMAT '/_standby_cntrl_%s_%p_%t.bak' CURRENT CONTROLFILE for standby;
 RELEASE CHANNEL d1;
 RELEASE CHANNEL d2;
 RELEASE CHANNEL d3;
 RELEASE CHANNEL d4;
 RELEASE CHANNEL d5;
 RELEASE CHANNEL d6;
 RELEASE CHANNEL d7;
 RELEASE CHANNEL d8;
 RELEASE CHANNEL d9;
 RELEASE CHANNEL d10;
}


For RMAN cold backup, shutdown the database and bring it up in mount state. The use RMAN script for backup.

No comments: