root用户下

[root@localhost ~]# mkdir /nstg
[root@localhost ~]# cd /nstg/
[root@localhost nstg]# mkdir bin log tmp
[root@localhost nstg]# chown -R oracle:oinstall  /nstg
[root@localhost nstg]# su - oracle
[oracle@localhost ~]$ cd /nstg/bin

 vi del_arch.sh
#!/bin/bash
echo "----------------------------------------`date`---------------------------------------"
source ~/.bash_profile
rman target / <<EOF
crosscheck archivelog all;
delete noprompt expired archivelog all;
delete noprompt archivelog all completed before 'sysdate-7';
EOF
echo -e "\n"
echo "------------------------------------ FINISHED ------------------------------------"

[oracle@localhost bin]$ crontab -e

* 1 * * *  nstg/bin/del_arc.sh 

来源

相关文章:

  • 2022-01-16
  • 2021-10-16
  • 2022-12-23
  • 2021-06-24
  • 2021-08-09
  • 2022-12-23
  • 2022-12-23
  • 2021-06-24
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-03-03
  • 2021-11-22
  • 2021-08-15
  • 2021-12-07
  • 2022-12-23
相关资源
相似解决方案