1. delete archivelog:
#! /bin/bash
source ~/.bash_profile
exec >> /home/oracle/dbscripts/logs/del_archdate +%F_%H
.log
$ORACLE_HOME/bin/rman target / <<EOF
crosscheck archivelog all;
delete noprompt expired archivelog all;
delete noprompt archivelog until time ‘sysdate-2’;
exit;
EOF
2. backup_full.sh
#!/bin/ksh
source ~/.bash_profile
echo “------------------Start------------------”;date
#backup start
$ORACLE_HOME/bin/rman log=/home/oracle/dbscripts/logs/rman_full_backup.log << EOF
connect target /
run{
CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 2 DAYS;
CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT ‘/arch/full_%d_%s_%T_%t.bak’;
crosscheck backupset;
delete noprompt expired backupset;
delete noprompt obsoleted;
backup full AS COMPRESSED BACKUPSET DATABASE include