oracle rman 增量备份
2015-05-08 10:24
477 查看
采用0112111增量备份策略,7天一个轮回
也就是周日0级备份,周1 2 4 5 6 采用2级增量备份,周3采用1级增量备份
配置控制文件备份路径
RMAN > CONFIGURE CONTROLFILE AUTOBACKUP
FORMAT FOR DEVICE
TYPE DISK TO
'/u01/backup/rmanbk/ccontrolfile_%F';
数据备份目录
$ mkdir -p /u01/backup/rmanbk
首先将过期天数设为7天
RMAN> CONFIGURE RETENTION POLICY
TO RECOVERY WINDOW
OF 7 DAYS;
下面开始创建0级 1级 2级备份脚本
0级备份脚本
vim rman_bk_level0.sh
------0级备份----------------
#! /bin/bash
export ORACLE_SID=orcl
export NLS_LANG='AMERICAN_AMERICA.ZHS16GBK'
/u01/app/oracle/11.2.0/dbhome_1/bin/rman
target / <<EOF
run{
allocate channel d1 type disk;
allocate channel d2 type disk;
backup incremental level 0
database format
'/u01/backup/rmanbk/level0_%d_%s_%p_%u.bkp';
sql 'alter system archive log current';
backup archivelog all
delete input
format '/u01/backup/rmanbk/log_%d_%s_%p_u%.bkp';
}
crosscheck backup;
delete noprompt obsolete;
exit;
<<EOF
------------------
1级备份脚本
vim rman_bk_level1.sh
---------1级增量备份---------------
#! /bin/bash
export ORACLE_SID=orcl
export NLS_LANG='AMERICAN_AMERICA.ZHS16GBK'
/u01/app/oracle/11.2.0/dbhome_1/bin/rman
target / <<EOF
run{
allocate channel d1 type disk;
allocate channel d2 type disk;
backup incremental level 1
database format
'/u01/backup/rmanbk/level1_%d_%s_%p_%u.bkp';
sql 'alter system archive log current';
backup archivelog all
delete input
format '/u01/backup/rmanbk/log_%d_%s_%p_u%.bkp';
}
crosscheck backup;
delete noprompt obsolete;
exit;
<<EOF
2级备份脚本
vim rman_bk_level2.sh
---------2级增量备份---------------
#! /bin/bash
export ORACLE_SID=orcl
export NLS_LANG='AMERICAN_AMERICA.ZHS16GBK'
/u01/app/oracle/11.2.0/dbhome_1/bin/rman
target / <<EOF
run{
allocate channel d1 type disk;
allocate channel d2 type disk;
backup incremental level 2
database format
'/u01/backup/rmanbk/level2_%d_%s_%p_%u.bkp';
sql 'alter system archive log current';
backup archivelog all
delete input
format '/u01/backup/rmanbk/log_%d_%s_%p_u%.bkp';
}
crosscheck backup;
delete noprompt obsolete;
release d1;
exit;
<<EOF
加入到crontab中
crontab -e
-----------
#周日0级备份
00 23 * * 0 /u01/backup_shell/rman_bk_level0.sh
#周一、二、四、五、六2级增量备份
00 23 * * 1,2,4,5,6 /u01/backup_shell/rman_bk_level2.sh
#周三1级增量备份
00 23 * * 3 /u01/backup_shell/rman_bk_level1.sh
-------------
结束!
也就是周日0级备份,周1 2 4 5 6 采用2级增量备份,周3采用1级增量备份
配置控制文件备份路径
RMAN > CONFIGURE CONTROLFILE AUTOBACKUP
FORMAT FOR DEVICE
TYPE DISK TO
'/u01/backup/rmanbk/ccontrolfile_%F';
数据备份目录
$ mkdir -p /u01/backup/rmanbk
首先将过期天数设为7天
RMAN> CONFIGURE RETENTION POLICY
TO RECOVERY WINDOW
OF 7 DAYS;
下面开始创建0级 1级 2级备份脚本
0级备份脚本
vim rman_bk_level0.sh
------0级备份----------------
#! /bin/bash
export ORACLE_SID=orcl
export NLS_LANG='AMERICAN_AMERICA.ZHS16GBK'
/u01/app/oracle/11.2.0/dbhome_1/bin/rman
target / <<EOF
run{
allocate channel d1 type disk;
allocate channel d2 type disk;
backup incremental level 0
database format
'/u01/backup/rmanbk/level0_%d_%s_%p_%u.bkp';
sql 'alter system archive log current';
backup archivelog all
delete input
format '/u01/backup/rmanbk/log_%d_%s_%p_u%.bkp';
}
crosscheck backup;
delete noprompt obsolete;
exit;
<<EOF
------------------
1级备份脚本
vim rman_bk_level1.sh
---------1级增量备份---------------
#! /bin/bash
export ORACLE_SID=orcl
export NLS_LANG='AMERICAN_AMERICA.ZHS16GBK'
/u01/app/oracle/11.2.0/dbhome_1/bin/rman
target / <<EOF
run{
allocate channel d1 type disk;
allocate channel d2 type disk;
backup incremental level 1
database format
'/u01/backup/rmanbk/level1_%d_%s_%p_%u.bkp';
sql 'alter system archive log current';
backup archivelog all
delete input
format '/u01/backup/rmanbk/log_%d_%s_%p_u%.bkp';
}
crosscheck backup;
delete noprompt obsolete;
exit;
<<EOF
2级备份脚本
vim rman_bk_level2.sh
---------2级增量备份---------------
#! /bin/bash
export ORACLE_SID=orcl
export NLS_LANG='AMERICAN_AMERICA.ZHS16GBK'
/u01/app/oracle/11.2.0/dbhome_1/bin/rman
target / <<EOF
run{
allocate channel d1 type disk;
allocate channel d2 type disk;
backup incremental level 2
database format
'/u01/backup/rmanbk/level2_%d_%s_%p_%u.bkp';
sql 'alter system archive log current';
backup archivelog all
delete input
format '/u01/backup/rmanbk/log_%d_%s_%p_u%.bkp';
}
crosscheck backup;
delete noprompt obsolete;
release d1;
exit;
<<EOF
加入到crontab中
crontab -e
-----------
#周日0级备份
00 23 * * 0 /u01/backup_shell/rman_bk_level0.sh
#周一、二、四、五、六2级增量备份
00 23 * * 1,2,4,5,6 /u01/backup_shell/rman_bk_level2.sh
#周三1级增量备份
00 23 * * 3 /u01/backup_shell/rman_bk_level1.sh
-------------
结束!
相关文章推荐
- ORACLE-RMAN:备份脚本(全库,增量)
- oracle 数据库rman+crontab自动差异增量备份
- 示例说明Oracle RMAN两种库增量备份的差别
- Oracle 学习之RMAN(四)增量备份
- Oracle RMAN物理备份之RMAN增量备份
- oracle RMAN增量备份与备份策略
- oracle中Rman增量备份下各级别level的区别
- ORACLE RMAN备份及还原 RMAN能够进行增量备份:数据库,表空间,数据文件
- ORACLE RMAN增量备份经典理解
- oracle:rman恢复----通过增量备份来恢复
- 探索ORACLE之RMAN_05增量备份
- ORACLE RMAN备份--差异增量与累积增量的策略实例图
- oracle rman 增量备份完整恢复测试
- [Rman]Oracle Rman增量备份Level012脚本
- oracle:rman恢复----通过增量备份来恢复
- ORACLE RMAN增量备份经典理解 2
- Oracle RMAN 备份(五)--增量备份
- oracle:rman恢复----通过增量备份来恢复
- oracle rman 实验(oracle rman Cumulative累积增量备份和恢复)
- Oracle-Rman 增量备份计划任务