#!/bin/bash
echo "----------------------------------------`date`---------------------------------------"
source ~/.bash_profile
rman target / >> delarchive.log <<EOF # 记录日志delarchive.log 可以后期检查是否执行成功
crosscheck archivelog all; # 把无效的expired的archivelog标出来
delete noprompt expired archivelog all; # 直接全部删除过期的归档日志
delete noprompt archivelog all completed before 'sysdate-1/2'; # 直接删除半天前所有的归档日志
exit
EOF
echo -e "\n"
echo "------------------------------------ FINISHED ------------------------------------"
03-06
2035