新入行DBA,带着强烈的求知欲望混迹于各社区,学习高人经验,愿得高人赐教,必将感激不尽。 真心感谢将宝贵经验分享给我们这些菜鸟的前辈们!
全部博文(10)
分类: Oracle
2013-10-29 16:31:41
原文地址:备份脚本 oracle rman 作者:lzp_0004
备份脚本:
0级增量备份脚本
$ vi level_0_bk.sh
#!/bin/bash
ORACLE_BASE=/u01/oracle
ORACLE_HOME=/u01/oracle/product/10.2.0
ORACLE_SID=cuug
PATH=$PATH:$ORACLE_HOME/bin
export ORACLE_BASE ORACLE_HOME ORACLE_SID PATH
/u01/oracle/product/10.2.0/bin/rman target /
<
run{
backup
incremental level 0 database format='/backup/level_0_%c_%s_%p.bak' tag='level
0'
include
current controlfile;
backup
archivelog all format='/backup/arch_%c_%s_%p.bak' delete input;
sql
'alter system archive log current';
}
crosscheck
backup;
delete
noprompt obsolete;
exit;
EOF
2级增量备份:
$ vi level_2_bk.sh
#!/bin/bash
ORACLE_BASE=/u01/oracle
ORACLE_HOME=/u01/oracle/product/10.2.0
ORACLE_SID=cuug
PATH=$PATH:$ORACLE_HOME/bin
export
ORACLE_BASE ORACLE_HOME ORACLE_SID PATH
/u01/oracle/product/10.2.0/bin/rman target /
<
run{
backup
incremental level 2 database format='/backup/level_2_%c_%s_%p.bak' tag='level
2'
include
current controlfile;
backup
archivelog all format='/backup/arch_%c_%s_%p.bak' delete input;
sql
'alter system archive log current';
}
crosscheck
backup;
delete
noprompt obsolete;
exit;
EOF