当前位置:网站首页>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无法正常备份删除
边栏推荐
- KeePass realizes automatic input of web pages
- 包装行业智能供应链S2B2B商城解决方案:开辟电商消费新生态
- 2022 Season 6 perfect children's model Shaanxi finals came to a successful conclusion
- Given an array, such as [7864, 284, 347, 7732, 8498], now you need to splice the numbers in the array to return the "largest possible number."
- B_ QuRT_ User_ Guide(38)
- SQL database execution problems
- Balanced binary tree [AVL tree] - insert, delete
- Oracle statistics by time
- Anxin can internally test offline voice module vb-01 to communicate with esp-c3-12f
- Sequence of entity layer, Dao layer, service layer and controller layer
猜你喜欢
![[stm32+esp8266 connect Tencent cloud IOT development platform 2] stm32+esp8266-01s connect Tencent cloud](/img/78/3cc67a28872ff4d465484cbaee2f6e.jpg)
[stm32+esp8266 connect Tencent cloud IOT development platform 2] stm32+esp8266-01s connect Tencent cloud

Senior programmers must know and master. This article explains in detail the principle of MySQL master-slave synchronization, and recommends collecting

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

Markdown

Get started with mongodb

Svn relocation

Ora-02437 failed to verify the primary key violation

MySQL架构
postgis学习

MySQL Index Optimization Practice II
随机推荐
Idea automatically generates serialVersionUID
SAP 内存参数调优过程
The 19th Zhejiang Provincial College Programming Contest VP record + supplementary questions
Arbre binaire équilibré [Arbre AVL] - Insérer et supprimer
New potential energy of industrial integration, Xiamen station of city chain technology digital summit successfully held
SAP memory parameter tuning process
The file format and extension of XLS do not match
Pycharm essential plug-in, change the background (self use, continuous update) | CSDN creation punch in
移动端异构运算技术 - GPU OpenCL 编程(基础篇)
One week learning summary of STL Standard Template Library
家用电器行业渠道商协同系统解决方案:助力家电企业快速实现渠道互联网化
[stm32+esp8266 connect Tencent cloud IOT development platform 2] stm32+esp8266-01s connect Tencent cloud
B_ QuRT_ User_ Guide(38)
Installing gradle
Summary of common methods of object class (September 14, 2020)
USB (XIV) 2022-04-12
Force deduction solution summary 648 word replacement
Given an array, such as [7864, 284, 347, 7732, 8498], now you need to splice the numbers in the array to return the "largest possible number."
B_ QuRT_ User_ Guide(40)
2022 Season 6 perfect children's model Shaanxi finals came to a successful conclusion