当前位置:网站首页>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无法正常备份删除
边栏推荐
- Right click the idea file to create new. There is no solution to create new servlet
- SAP HR social work experience 0023
- postgis学习
- Flash encryption process and implementation of esp32
- ESP at installation esp8266 and esp32 versions
- Oracle statistics by time
- Solution of intelligent supply chain collaboration platform in electronic equipment industry: solve inefficiency and enable digital upgrading of industry
- Oracle string sorting
- 进度播报|广州地铁七号线全线29台盾构机全部完成始发
- [experiment sharing] log in to Cisco devices through the console port
猜你喜欢
B_QuRT_User_Guide(36)
[stm32+esp8266 connect Tencent cloud IOT development platform 2] stm32+esp8266-01s connect Tencent cloud
C number of words, plus ¥, longest word, average value
0-1 knapsack problem
Navicat connects Oracle
Summary of SQL single table query 2020.7.27
B_QuRT_User_Guide(38)
Live server usage
Ora-02437 failed to verify the primary key violation
[experiment sharing] log in to Cisco devices through the console port
随机推荐
C inheritance and interface design polymorphism
Map operation execution process
The for loop realizes 1-100 addition and eliminates the 4-digit tail number
Balanced binary tree [AVL tree] - insert, delete
建筑建材行业SRM供应商云协同管理平台解决方案,实现业务应用可扩展可配置
Stringutils tool class
C simple question 2
Interface
UE4_ Ue5 panoramic camera
Markdown
Installing gradle
伸展树(一) - 图文解析与C语言实现
SAP HR reward and punishment information export
0-1背包问题
2022注册测绘师备考开始 还在不知所措?手把手教你怎么考?
Progress broadcast | all 29 shield machines of Guangzhou Metro Line 7 have been launched
Boost regex library source code compilation
IDEA 2021.3. X cracking
B_ QuRT_ User_ Guide(40)
New potential energy of industrial integration, Xiamen station of city chain technology digital summit successfully held