对于归档在ASM中的,使用如下的脚本
-
. /home/oracle/.bash_profile
-
/u01/app/oracle/product/11.2.0/db/bin/rman nocatalog log=/home/oracle/del_arch$(date +%Y-%m-%d).log <<EOF
-
connect target /
-
crosscheck archivelog all;
-
delete noprompt expired archivelog all;
-
DELETE noprompt ARCHIVELOG ALL COMPLETED BEFORE 'SYSDATE-7';
-
exit;
-
EOF
对于归档在本地的,使用如下的命令:
-
0 0,3,6,9,12,15,18,21 * * * /usr/bin/find /u02/archive/storedb -ctime +5 | xargs rm -f
-
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/25462274/viewspace-2124964/
,如需转载,请注明出处,否则将追究法律责任。