RMAN一周典型备份方案
RMAN一周典型备份方案
原创wx5caecf2ed0645 2021-08-10 09:59:03 博主文章分类:Oracle
================== RMAN一周典型备份方案 ===============
1.星期天晚上 -level 0 backup (全备份)
2.星期一晚上 -level 2 backup
3.星期二晚上 -level 2 backup
4.星期三晚上 -level 1 backup
5.星期四晚上 -level 2 backup
6.星期五晚上 -level 2 backup
7.星期六晚上 -level 2 backup
如果星期二需要恢复的话,只需要1+2,
如果星期四需要恢复的话,只需要1+4,
如果星期五需要恢复的话,只需要1+4+5,
如果星期六需要恢复的话,只需要1+4+5+6.
自动备份:备份脚本+crontab
bakl0
bakl1
bakl2
配置:
1: mkdir -p /u01/app/oracle/rmanbak/scripts/ (放备份脚本目录)
2: mkdir -p /u01/app/oracle/rmanbak/logs/ (放日志目录)
3: mkdir -p /u01/app/oracle/rmanbak/bak/ (放备份文件的目录)
4: crontab -e -u root
30 23 * * 0 /u01/app/oracle/rmanbak/scripts/bakl0
30 23 * * 0 /u01/app/oracle/rmanbak/scripts/bakl2
30 23 * * 0 /u01/app/oracle/rmanbak/scripts/bakl2
30 23 * * 0 /u01/app/oracle/rmanbak/scripts/bakl1
30 23 * * 0 /u01/app/oracle/rmanbak/scripts/bakl2
30 23 * * 0 /u01/app/oracle/rmanbak/scripts/bakl2
30 23 * * 0 /u01/app/oracle/rmanbak/scripts/bakl2
5: service crond restart
6: 附件
-------------------bakl0脚本------------------
#!/bin/sh
cd /u01/app/oracle/rmanbak/scripts
su - oracle -c "rman target / msglog=/u01/app/oracle/rmanbak/logs/bakl0.log < /u01/app/oracle/rmanbak/scripts/bakl0.bak"
-------------------bakl0.bak脚本--------------
run {
allocate channel c1 device type disk;
allocate channel c2 device type disk;
allocate channel c3 device type disk;
allocate channel c4 device type disk;
backup incremental level 0 format '/u01/app/oracle/rmanbak/bak/inc0_%u_%T' tag sunday_inc0 database;
release channel c1;
release channel c2;
release channel c3;
release channel c4;
}
-------------------bakl1脚本------------------
#!/bin/sh
cd /u01/app/oracle/rmanbak/scripts
su - oracle -c "rman target / msglog=/u01/app/oracle/rmanbak/logs/bakl1.log < /u01/app/oracle/rmanbak/scripts/bakl1.bak"
-------------------bakl1.bak脚本--------------
run {
allocate channel c1 device type disk;
allocate channel c2 device type disk;
allocate channel c3 device type disk;
allocate channel c4 device type disk;
backup incremental level 1 format '/u01/app/oracle/rmanbak/bak/inc1_%u_%T' tag inc1 database;
release channel c1;
release channel c2;
release channel c3;
release channel c4;
}
-------------------bakl2脚本------------------
#!/bin/sh
cd /u01/app/oracle/rmanbak/scripts
su - oracle -c "rman target / msglog=/u01/app/oracle/rmanbak/logs/bakl2.log < /u01/app/oracle/rmanbak/scripts/bakl2.bak"
-------------------bakl2.bak脚本--------------
run {
allocate channel c1 device type disk;
allocate channel c2 device type disk;
allocate channel c3 device type disk;
allocate channel c4 device type disk;
backup incremental level 2 format '/u01/app/oracle/rmanbak/bak/inc2_%u_%T' tag inc2 database;
release channel c1;
release channel c2;
release channel c3;
release channel c4;
}
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】凌霞软件回馈社区,博客园 & 1Panel & Halo 联合会员上线
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】博客园社区专享云产品让利特惠,阿里云新客6.5折上折
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 一个费力不讨好的项目,让我损失了近一半的绩效!
· 清华大学推出第四讲使用 DeepSeek + DeepResearch 让科研像聊天一样简单!
· 实操Deepseek接入个人知识库
· CSnakes vs Python.NET:高效嵌入与灵活互通的跨语言方案对比
· Plotly.NET 一个为 .NET 打造的强大开源交互式图表库
2021-01-15 How to Modify Private Network Information in Oracle Clusterware (Doc ID 283684.1)