这篇文章主要介绍了dg如何实现删除备库已经应用的归档日志脚本,具有一定借鉴价值,感兴趣的朋友可以参考下,希望大家阅读完这篇文章之后大有收获,下面让小编带着大家一起了解一下。
#!/bin/bash
#by ray
#2017-08-30
#v0.1
. ~/.bash_profile
#get sequence id that have applied.
[ -e /home/oracle/.applied_archivelog.txt ] && rm -f /home/oracle/.applied_archivelog.txt
sqlplus -s /nolog
conn / as sysdba
set heading off
set feedback o免费主机域名ff
set linesize 300
set pages 1000
col name for a100
spool /home/oracle/.applied_archivelog.txt
select sequence# from v$archived_log where applied=’YES’ order by sequence#;
spool off
exit
RAY
[ -e /home/oracle/.applied_archivelog.txt ] && seq=`tail -2 /home/oracle/.applied_archivelog.txt | sed -n ‘1p’` || (echo “delete archive log failed!” >> /home/oracle/log/delete_archivelog.log ; exit 1)
logfile=/home/oracle/log/delete_archivelog_`date +%Y%m%d-%H%M%S`.log
rman target / log $logfile append
delete noprompt archivelog until sequence ${seq};
crosscheck archivelog all;
delete noprompt expi免费主机域名red archivelog all;
exit;
EOF感谢你能够认真阅读完这篇文章,希望小编分享的“dg如何实现删除备库已经应用的归档日志脚本”这篇文章对大家有帮助,同时也希望大家多多支持云技术,关注云技术行业资讯频道,更多相关知识等着你来学习!
这篇文章给大家分享的是有关怎么写好SQL的内容。小编觉得挺实用的,因此分享给大家做个参考,一起跟随小编过来看看吧。最大数据量抛开数据量和并发数,谈性能都是耍流氓。MySQL没有限制单表最大记录数,它取决于操作系统对文件大小的限制。《阿里巴巴Java开发手册》提…