玉祥平台客服-15087858732

标题: 《设置定时自动清理归档日志脚本 》 [打印本页]

作者: fteair    时间: 2020-6-30 17:35
标题: 《设置定时自动清理归档日志脚本 》
  1. root用户下

  2. [root@localhost ~]# mkdir /nstg
  3. [root@localhost ~]# cd /nstg/
  4. [root@localhost nstg]# mkdir bin log tmp
  5. [root@localhost nstg]# chown -R oracle:oinstall  /nstg
  6. [root@localhost nstg]# su - oracle
  7. [oracle@localhost ~]$ cd /nstg/bin

  8. vi del_arch.sh
  9. #!/bin/bash
  10. echo "----------------------------------------`date`---------------------------------------"
  11. source ~/.bash_profile
  12. rman target / <<EOF
  13. crosscheck archivelog all;
  14. delete noprompt expired archivelog all;
  15. delete noprompt archivelog all completed before 'sysdate-7';
  16. EOF
  17. echo -e "\n"
  18. echo "------------------------------------ FINISHED ------------------------------------"

  19. [oracle@localhost bin]$ crontab -e

  20. * 1 * * *  nstg/bin/del_arc.sh
复制代码



作者: caixuqad    时间: 2020-6-30 17:37

作者: 张兴康    时间: 2020-7-1 16:37

作者: caixuqad    时间: 2020-7-1 17:36

作者: fteair    时间: 2020-7-1 17:43





欢迎光临 玉祥平台客服-15087858732 (http://plat.delit.cn/) Powered by Discuz! X3.2