Linux下Oracle归档日志自动清理脚本代码(sh)
程序员文章站
2022-05-24 17:58:22
复制代码 代码如下: #!/bin/sh export back_date=`date +%y%m%d` export backup_path=/home/oracle/d...
复制代码 代码如下:
#!/bin/sh
export back_date=`date +%y%m%d`
export backup_path=/home/oracle/dbbak
echo `mkdir -p ${backup_path}/archivelog/${back_date}`
rman msglog=$backup_path/archivelog/${back_date}/arch_0_$back_date.log << eof
connect target /;
delete expired archivelog all;
delete noprompt archivelog until time 'sysdate - 1' ;
exit
eof
上一篇: python自动化报告的输出
下一篇: linux shell命令的常用快捷键