#!/bin/sh
ORACLE_BASE=/opt/app/oracle;
ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1;
ORACLE_SID=dzjg;
LD_LIBRARY_PATH=$ORACLE_HOME/lib;
PATH=$PATH:$ORACLE_HOME/bin:$HOME/bin;
export ORACLE_BASE ORACLE_HOME ORACLE_SID LD_LIBRARY_PATH PATH;
#rman target test173/test173
#da=`date +%F`
#$ORACLE_HOME/bin/rman target / catalog test173/test173 log=/home/oracle/backup_file/$da.log <<EOF
rman target system/dzjg4_AISINO_syj123 <<EOF
run{
crosscheck archivelog all;
delete noprompt expired archivelog all;
delete noprompt archivelog until time 'SYSDATE-15';
#allocate channel c1 type disk;
}
EOF
sourcefile=/opt/app/oracle/fast_recovery_area/ORCL/archivelog;
find $sourcefile -type f -name "*.arc" -mtime +5|xargs rm -fr;