ITPub博客

首页 > 数据库 > Oracle > 生产上删除归档的命令

生产上删除归档的命令

原创 Oracle 作者:531968912 时间:2016-09-14 11:09:31 0 删除 编辑

对于归档在ASM中的,使用如下的脚本


[sql] view plain copy
  1. . /home/oracle/.bash_profile  
  2. /u01/app/oracle/product/11.2.0/db/bin/rman nocatalog log=/home/oracle/del_arch$(date +%Y-%m-%d).log  <<EOF  
  3. connect target /  
  4. crosscheck archivelog all;  
  5. delete noprompt expired archivelog all;  
  6. DELETE noprompt ARCHIVELOG ALL COMPLETED BEFORE 'SYSDATE-7';  
  7. exit;  
  8. EOF  

对于归档在本地的,使用如下的命令:



[sql] view plain copy
  1. 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/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2014-09-24

  • 博文量
    576
  • 访问量
    1111404