当前位置:网站首页>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无法正常备份删除
边栏推荐
猜你喜欢

2022 Season 6 perfect children's model Shaanxi finals came to a successful conclusion

Anxinco esp32-a1s development board is adapted to Baidu dueros routine to realize online voice function

Home appliance industry channel business collaboration system solution: help home appliance enterprises quickly realize the Internet of channels

Solution of intelligent supply chain collaboration platform in electronic equipment industry: solve inefficiency and enable digital upgrading of industry
![[compilation principle] lexical analysis design and Implementation](/img/8c/a3a50e6b029c49caf0d791f7d4513a.png)
[compilation principle] lexical analysis design and Implementation

Take you hand in hand to build Eureka server with idea

MySQL Index Optimization Practice I

Markdown

包装行业智能供应链S2B2B商城解决方案:开辟电商消费新生态

KeePass realizes automatic input of web pages
随机推荐
IDEA 2021.3. X cracking
家用电器行业渠道商协同系统解决方案:助力家电企业快速实现渠道互联网化
How to change the formula picture in the paper directly into the formula in word
产业共融新势能,城链科技数字峰会厦门站成功举办
MySQL Architecture
B_ QuRT_ User_ Guide(38)
通达信买基金安全吗?
B_QuRT_User_Guide(39)
C method question 2
Installing gradle
2022第六季完美童模陕西总决赛圆满落幕
MySQL Index Optimization Practice I
Possible SQL for Oracle table lookup information
[experiment sharing] log in to Cisco devices through the console port
Unity3d learning notes 4 - create mesh advanced interface
UE4_ Use of ue5 blueprint command node (turn on / off screen response log publish full screen display)
B_QuRT_User_Guide(36)
Anti climbing means cracking the second
First week of July
B_QuRT_User_Guide(37)