Chinaunix首页 | 论坛 | 博客
  • 博客访问: 70026
  • 博文数量: 9
  • 博客积分: 2426
  • 博客等级: 大尉
  • 技术积分: 100
  • 用 户 组: 普通用户
  • 注册时间: 2009-02-19 13:55
文章分类

全部博文(9)

文章存档

2010年(3)

2009年(6)

分类: Oracle

2009-08-02 15:06:07

 

#!/bin/sh
. /home/oracle/.bash_profile
#del_tag=fullbak_rac_`date +%F -d "2 days ago"`
tag=fullbak_dxrpt_`date +%F`
cd /home/oracle/backsql
logname=rmanback_full_rac1_`date +%Y%m%d`.log
date +%F" "%T >>$logname
rman target / nocatalog msglog $logname append<<EOF
run
{
delete noprompt backup completed before 'sysdate-2';
ALLOCATE CHANNEL d1 DEVICE TYPE DISK ;
ALLOCATE CHANNEL d2 DEVICE TYPE DISK ;
backup incremental level 0 database tag '$tag'format '/back/full_rac_level0_%U';
backup current controlfile tag '$tag'format '/back/control_rac%T';
release CHANNEL d1 ;
release CHANNEL d2 ;

CROSSCHECK ARCHIVELOG ALL ;
ALLOCATE CHANNEL d3 DEVICE TYPE DISK format '/back/ARC_dxr_rac1_%U';
ALLOCATE CHANNEL d4 DEVICE TYPE DISK format '/back/ARC_dxr_rac2_%U';
backup archivelog all ;
release channel d3;
release channel d4;
}
EOF
rs=$?
echo "back status $rs" >>$logname
if [ "$rs" = "0" ];then
find /log1  -ctime +7  -exec rm -rvf {} \; >>$logname
find /log2  -ctime +7  -exec rm -rvf {} \; >>$logname
fi
date +%F" "%T  >>$logname

直接贴上script了,全备的,数据量不大,备份很快,150G数据1小时都不到,要增量干嘛
阅读(2350) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~