###############################################
#
# RMAN - delete archivelogs/backup sets from RECO area
#
#
#
#
###############################################
# Find what is available
for z in SED
do
NLS_DATE_FORMAT='YYYY-MM-DD HH24:MI:SS'
export NLS_DATE_FORMAT
rman target / <<END
list backup of database summary completed before 'SYSDATE -14' device type ='DISK';
END
done
# Delete backups
for z in SED
do
NLS_DATE_FORMAT='YYYY-MM-DD HH24:MI:SS'
export NLS_DATE_FORMAT
rman target / <<END
list backup of database summary completed before 'SYSDATE -14' device type ='DISK';
run {
allocate channel D1 type disk;
delete noprompt backupset completed before 'SYSDATE-14';
}
END
done
# Alternate versions to delete - NOTE - define BA first
for z in SED
do
export NLS_DATE_FORMAT='YYYY-MM-DD HH24:MI:SS'
rman target / debug trace=name.trc <<END
run {
allocate channel c1 type disk;
backup format '${BA}/${ORACLE_SID}_arch_%c:%s:%t_.arc'
archivelog all not backed up 2 times;
delete noprompt archivelog all completed before 'sysdate - 12/24';
release channel c1;
}
END
done
for z in SED
do
export NLS_DATE_FORMAT='YYYY-MM-DD HH24:MI:SS'
rman target / debug trace=name.trc <<END
run {
allocate channel c1 type disk;
backup format '${BA}/${ORACLE_SID}_arch_%c:%s:%t_.arc'
archivelog all not backed up 2 times delete input;
release channel c1;
}
END
done
No comments:
Post a Comment