Saturday, September 24, 2016

Archive backup and DELETE scripts

Script to delete archives, which are backed up tape

rman target /
DELETE ARCHIVELOG ALL COMPLETED BEFORE 'SYSDATE' BACKED UP 1 TIMES TO DEVICE TYPE 'SBT';

crosscheck archivelog all;

delete archivelog all backed up 1 times to device type sbt completed before 'sysdate-2/24';

delete archivelog all backed up 1 times to device type sbt;






Backup Archive scripts to tape and tape


run {
allocate channel t1 type 'sbt_tape';
allocate channel t2 type 'sbt_tape';
allocate channel t3 type 'sbt_tape';
allocate channel t4 type 'sbt_tape';
backup
filesperset 100
format '%t_%s_%r.arc'
archivelog all delete input skip inaccessible;
release channel t1;
release channel t2;
release channel t3;
release channel t4;
}



Backup Archive scripts to tape and disk

run {
allocate channel t1 type 'disk';
allocate channel t2 type 'disk';
allocate channel t3 type 'disk';
allocate channel t4 type 'disk';
backup
filesperset 100
format '%t_%s_%r.arc'
archivelog all delete input skip inaccessible;
release channel t1;
release channel t2;
release channel t3;
release channel t4;
}

No comments:

Post a Comment