当前位置:网站首页>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 number of words, plus ¥, longest word, average value
- Illegal behavior analysis 1
- 城联优品作为新力量初注入,相关上市公司股价应声上涨150%
- LM12丨Rolling Heikin Ashi二重K线滤波器
- MySQL Architecture
- Oracle statistics by time
- ESP at installation esp8266 and esp32 versions
- USB (XVIII) 2022-04-17
- Open source hardware small project: anxinco esp-c3f control ws2812
- S2b2b mall solution of intelligent supply chain in packaging industry: opening up a new ecosystem of e-commerce consumption
猜你喜欢
B_ QuRT_ User_ Guide(38)
Unity3d learning notes 5 - create sub mesh
SAP HR 家庭成员信息
移动端异构运算技术 - GPU OpenCL 编程(基础篇)
MySQL Architecture
PCB wiring rules of PCI Express interface
B_QuRT_User_Guide(38)
MySQL架构
Solution of intelligent supply chain collaboration platform in electronic equipment industry: solve inefficiency and enable digital upgrading of industry
SAP HR 劳动合同信息 0016
随机推荐
8.31 Tencent interview
Oracle string sorting
Lm12 rolling heikin Ashi double K-line filter
The 19th Zhejiang Provincial College Programming Contest VP record + supplementary questions
Right click the idea file to create new. There is no solution to create new servlet
ESP at installation esp8266 and esp32 versions
648. Word replacement
What if once again forgets the login password of raspberry pie? And you don't have a monitor yet! Today, I would like to introduce a method
SAP HR 社会工作经历 0023
C simple question one
Live-Server使用
Possible SQL for Oracle table lookup information
LM12丨Rolling Heikin Ashi二重K线滤波器
The for loop realizes 1-100 addition and eliminates the 4-digit tail number
UE4_ Ue5 panoramic camera
伸展树(一) - 图文解析与C语言实现
SAP HR labor contract information 0016
SAP HR 劳动合同信息 0016
[STM32 + esp-12s connect Tencent cloud IOT development platform 1] creation of cloud platform and burning of at firmware
C method question 1