当前位置:网站首页>Dataguard 主备清理归档设置
Dataguard 主备清理归档设置
2022-07-07 21:53:00 【Joyce.Du】
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无法正常备份删除
边栏推荐
- C # exchange number, judge to pass the exam
- 伸展树(一) - 图文解析与C语言实现
- List. How to achieve ascending and descending sort() 2020.8.6
- 0-1 knapsack problem
- 进度播报|广州地铁七号线全线29台盾构机全部完成始发
- SAP HR reward and punishment information export
- Take you hand in hand to build Eureka server with idea
- C cat and dog
- 2022第六季完美童模陕西总决赛圆满落幕
- Live-Server使用
猜你喜欢
Mobile heterogeneous computing technology - GPU OpenCL programming (basic)
The efficient s2b2c e-commerce system helps electronic material enterprises improve their adaptability in this way
城联优品作为新力量初注入,相关上市公司股价应声上涨150%
UE4_ Use of ue5 blueprint command node (turn on / off screen response log publish full screen display)
SAP HR 家庭成员信息
高效的S2B2C电商系统,是这样帮助电子材料企业提升应变能力的
Map operation execution process
MongoDB快速入门
Anxinco EC series modules are connected to the multi protocol access products of onenet Internet of things open platform
Take you hand in hand to build Eureka client with idea
随机推荐
windows设置redis开启自动启动
Get started with mongodb
MongoDB快速入门
One week learning summary of STL Standard Template Library
C simple question one
Navicat connects Oracle
UE4_ Ue5 combined with Logitech handle (F710) use record
Ora-01741 and ora-01704
Ora-02437 failed to verify the primary key violation
Boost regex library source code compilation
城联优品作为新力量初注入,相关上市公司股价应声上涨150%
0-1 knapsack problem
Unity3d Learning Notes 6 - GPU instantiation (1)
Solution of intelligent supply chain collaboration platform in electronic equipment industry: solve inefficiency and enable digital upgrading of industry
Lm12 rolling heikin Ashi double K-line filter
B_QuRT_User_Guide(39)
Take you hand in hand to build feign with idea
Anxin can internally test offline voice module vb-01 to communicate with esp-c3-12f
Slam interview summary
【实验分享】通过Console口登录到Cisco设备