RMAN一周典型备份方案
原创
©著作权归作者所有:来自51CTO博客作者bbhaii的原创作品,谢绝转载,否则将追究法律责任
================== 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;
}
上一篇:redhat linux加密卷
下一篇:我的友情链接
提问和评论都可以,用心的回复会被更多人看到
评论
发布评论
相关文章
-
Oracle RMAN备份还原方案
oracle
oracle 还原方案 -
rman 备份一
rman备份脚本
oracle rman -
工作一周
公司用我以前讨厌用的linux,现在用着感觉还好,kdevelop开发c++,渐渐的也习惯了。做公司出的
控制变量 c++ linux