Saturday, 19 September 2020

RMAN Full Backup Script

dt=`date +"%d.%m.%Y"`

rman <<EOF

       spool msglog to '/backup/RMAN/logs/rman_level0_oraprod$dt.log'

        connect target /

        crosscheck archivelog all;

run

{

        allocate channel c1 type disk;

        allocate channel c2 type disk;

BACKUP as compressed backupset INCREMENTAL LEVEL=0 TAG ORAROD_LEVEL0 FILESPERSET 3

FORMAT '/backup/RMAN/FULL/ORAPROD_%s_%p_%t.rman'   DATABASE;

sql 'alter system archive log current';

RELEASE CHANNEL c1;

RELEASE CHANNEL c2;


allocate channel c1 type disk;

BACKUP

FORMAT '/backup/RMAN/FULL/ORAPRODctrl_%s_%p_%t.rman'

CURRENT CONTROLFILE;

RELEASE CHANNEL c1;

allocate channel c1 type disk;

allocate channel c2 type disk;

BACKUP  as compressed backupset FILESPERSET 5

FORMAT '/backup/RMAN/FULL/ORAPROD_ARC_%s_%p_%t.rman'

ARCHIVELOG ALL skip inaccessible;

RELEASE CHANNEL c1;

RELEASE CHANNEL c2;

allocate channel c1 type disk;

copy current controlfile to '/backup/RMAN/FULL/ORAPRODcontrol.rman';

RELEASE CHANNEL c1;

}

EXIT;

EOF



No comments:

Post a Comment