Dataguard 主备清理归档设置

cat /rmancc/shell/rmanlog.sh

#!/bin/sh

export ORACLE_SID=cc

rman target / <<EOF

run{

sql 'alter system archive log current' ;

backup format '/rmancc/%d_log_%T_%U' archivelog until time 'sysdate' delete all input ;

delete noprompt obsolete;

}

quit;

EOF

cat /rmancc/shell/rmanlog_clear.sh

#!/bin/sh

export ORACLE_SID=cc

rman target / <<EOF

run{

crosscheck archivelog all;

delete noprompt expired archivelog all;

delete noprompt archivelog  until time 'sysdate';

}

quit;

EOF

PR端:

root crontab 清理archivelog部分:

0,30 * * * * su - oracle -c "/rmancc/shell/rmanlog.sh" 1>>/rmancc/shell/rmanlog.log 2>>/rmancc/shell/rmanlog.err

#0,30 * * * * su - oracle -c "/rmancc/shell/rmanlog_clear.sh" 1>>/rmancc/shell/rmanlog_clear.log 2>>/rmancc/shell/rmanlog_clear.err

DR端:

root crontab 清理archivelog部分:

#0,30 * * * * su - oracle -c "/rmancc/shell/rmanlog.sh" 1>>/rmancc/shell/rmanlog.log 2>>/rmancc/shell/rmanlog.err

0,30 * * * * su - oracle -c "/rmancc/shell/rmanlog_clear.sh" 1>>/rmancc/shell/rmanlog_clear.log 2>>/rmancc/shell/rmanlog_clear.err

当容灾切换时,需要将PR端的crontab转为DR端的crontab;

将DR端的crontab转为PR端的crontab;

回切后再恢复原来的crontab

注意:

(1)当dr的mrp进程没起,但是数据库起着(tnsname通),pr的归档会由pr的lns正常传输到dr,此时dr的归档删除的脚本无法删除没有应用的归档,报错如下:

RMAN-08137: warning: archived log not deleted, needed for standby or upstream capture process

所以dr的归档目录很容易满,一旦dr的归档目录满,就会导致pr无法继续传输归档,从而导致pr端的归档无法正常删除,删除的时候也会报RMAN-08137: warning: archived log not deleted, needed for standby or upstream capture process,最后导致pr归档满,引发故障;

(2)如果dr的监听异常,pr无法传输归档到dr,pr无法正常备份删除

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值