root用户下
mkdir -p /home/temp
cd temp
mkdir bin log tmp
chown -R oracle:oinstall /home/temp/bin
chown -R oracle:oinstall /home/temp/log
chown -R oracle:oinstall /home/temp/tmp
cd /home/temp/bin
vi del_arc.sh
vi del_arc.sh
#! /bin/bash
source ~/.bash_profile
$ORACLE_HOME/bin/rman target /<<EOF
crosscheck archivelog all;
delete noprompt expired archivelog all;
delete noprompt archivelog until time 'sysdate-7';
exit;
EOF
crontab -e
* 1 * * * /home/temp/bin/del_arc.sh
#! /bin/bash
source ~/.bash_profile
$ORACLE_HOME/bin/rman target /<<EOF
crosscheck archivelog all;
delete noprompt expired archivelog all;
delete noprompt archivelog until time 'sysdate-7';
exit;
EOF
crontab -e
* 1 * * * /home/temp/bin/del_arc.sh