#!/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小时都不到,要增量干嘛
阅读(2345) | 评论(0) | 转发(0) |