just do it
分类: Oracle
2013-10-14 21:37:18
备份脚本:
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