oracle数据库增量备份!

:lol 不知那位大大有oracle增量备份的资料,最好是详细设置文档一起共享一下!先谢过了:victory: :hug:
参与1

1同行回答

jackengjackeng售前工程师广州
不知道楼主要用什么备份工具?转一个rman增量备份的脚本,供楼主参考一下:lol 备份策略:每周日凌晨做0级备份,每周一,四做一级备份,每周二,三,五,六做二级备份,00 4 * * 0 /u01/app/oracle/rman_bak/scripts/rman_bak.sh 000 4 * * 1,4 /u01/app/oracle/rman_bak/scripts/rman_bak.s...显示全部
不知道楼主要用什么备份工具?转一个rman增量备份的脚本,供楼主参考一下:lol

备份策略:
每周日凌晨做0级备份,
每周一,四做一级备份,
每周二,三,五,六做二级备份,
00 4 * * 0 /u01/app/oracle/rman_bak/scripts/rman_bak.sh 0
00 4 * * 1,4 /u01/app/oracle/rman_bak/scripts/rman_bak.sh 1
00 4 * * 2,3,5,6 /u01/app/oracle/rman_bak/scripts/rman_bak.sh 2
备份脚本:
#!/bin/bash
#set env
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/db10g
export ORACLE_SID=emar
export NLS_LANG=AMERICAN_AMERICA.ZHS16GBK
export PATH=$ORACLE_HOME/bin:$PATH
DATE=`date +%w`
DATE_2=`date +%Y%m%d`
BACKUP_PATH=/u01/app/oracle/rman_bak
LEVEL=$@
TARGET_SID=emar
RMAN_SID=emar.emar
BIN=/u01/app/oracle/db10g/bin
# Delete the data backuped last time
rm -rf $BACKUP_PATH/data/$DATE/*
if [ $# != 1 ]; then
echo "usage: rman_bak.sh n
where n is the rman backup level(0,1,2 is permitted)."
exit 1
fi
if [ $@ -ne 0 -a $@ -ne 1 -a $@ -ne 2 ]; then
echo "usage: rman_bak.sh n
where n is the rman backup level(Only 0,1,2 is permitted)."
exit 2
fi
echo "-----------------------------start-----------------------------";date
if [ $LEVEL = 0 ]; then
$BIN/rman log $BACKUP_PATH/log/level.$TARGET_SID.$LEVEL.$DATE_2.log <connect target sys/sys202;
connect catalog [email=rman/rman@$RMAN_SID]rman/rman@$RMAN_SID[/email];
resync catalog;
run{
allocate channel c1 type disk ;
crosscheck backupset of archivelog all ;
backup filesperset 3 format '$BACKUP_PATH/data/$DATE/arch.%d.live.$LEVEL.%t'(archivelog from time 'sysdate-7' all delete input) ;
delete noprompt expired backupset of archivelog all ;
release channel c1 ;
}
run{
allocate channel c2 type disk ;
crosscheck backupset of database ;
backup incremental level $LEVEL filesperset 3 format '$BACKUP_PATH/data/$DATE/data.%d.live.$LEVEL.%t'(database include current controlfile) ;
delete noprompt expired backupset of database ;
delete noprompt obsolete ;
release channel c2 ;
}
exit;
EOF
else
$BIN/rman log $BACKUP_PATH/log/level.$TARGET_SID.$LEVEL.$DATE_2.log <connect target sys/sys202;
connect catalog [email=rman/rman@$RMAN_SID]rman/rman@$RMAN_SID[/email];
resync catalog;
run{
allocate channel c1 type disk ;
crosscheck backupset of archivelog all ;
backup filesperset 3 format '$BACKUP_PATH/data/$DATE/arch.%d.live.$LEVEL.%t' (archivelog from time 'sysdate-1' all) ;
delete noprompt expired backupset of archivelog all ;
release channel c1 ;
}
run{
allocate channel c2 type disk ;
crosscheck backupset of database ;
backup incremental level $LEVEL filesperset 3 format '$BACKUP_PATH/data/$DATE/data.%d.live.$LEVEL.%t' (database include current controlfile) ;
delete noprompt expired backupset of database ;
delete noprompt obsolete ;
release channel c2 ;
}
exit;
EOF
fi
$BIN/exp [email=rman/rman@$RMAN_SID]rman/rman@$RMAN_SID[/email] file=$BACKUP_PATH/data/$DATE/live.rman.$DATE_2.dmp log=$BACKUP_PATH/log/$RMAN_SID.rman.$DATE_2.log
echo "------------------------------end------------------------------";date收起
IT分销/经销 · 2009-01-08
浏览320

提问者

hschenliang
技术支持工程师久其软件

相关问题

相关资料

相关文章

问题状态

  • 发布时间:2009-01-08
  • 关注会员:0 人
  • 问题浏览:3737
  • 最近回答:2009-01-08
  • X社区推广