设置定时任务用rman删除归档日志脚本

之前使用数据库数据迁移过程中出现产生大量归档日志的情况(由于迁移的目标库是DG,必须开启归档)。

为避免出现归档空间爆掉的情况,设置定时任务删除系统当前时间30分钟前的归档日志,脚本如下:

cat delete_archivelog_30min.sh

#!/bin/bash

source ~/profile_prod1
$ORACLE_HOME/bin/rman target / log=delete_archivelog.log<<eof
crosscheck archivelog all;
delete archivelog until time 'sysdate-30/1440';
crosscheck archivelog all;
exit;
eof
 
 

猜你喜欢

转载自www.cnblogs.com/orcl-2018/p/11913286.html
今日推荐