?
RMAN--full--incr0--incr1三合一脚本(三)
OGFILE} ];
then touch ${LOGFILE}
fi
if [ ! -f ${RMANLOG} ];
then touch ${RMANLOG}
fi
#-------------start incr1 backup-----------------
echo "-------------------------Rman incr1 backup -------------------------" >> ${LOGFILE}
echo "backup_incr1 start time:" `date +%Y-%m-%d_%H:%M:%S` >> ${LOGFILE}
echo "----------------------Rman Database backup_incr1 ------------"`date +%Y-%m-%d_%H:%M:%S` >${RMANLOG}
$ORACLE_HOME/bin/rman target / <> ${RMANLOG}
run
{
delete noprompt obsolete;
crosscheck archivelog all;
delete noprompt expired archivelog all;
allocate channel c1 type disk MAXPIECESIZE 5g;
allocate channel c2 type disk MAXPIECESIZE 5g;
allocate channel c3 type disk MAXPIECESIZE 5g;
allocate channel c4 type disk MAXPIECESIZE 5g;
allocate channel c5 type disk MAXPIECESIZE 5g;
backup AS COMPRESSED BACKUPSET incremental level 1 database tag 'incr1backup' filesperset 3 format '$RMAN_HOME/data/incr1/db_full_%T_%d_%t_%s_%p.rbck' include current controlfile;
backup AS COMPRESSED BACKUPSET format '$RMAN_HOME/archlog/arch_full_%T_%d_%t_%s_%p.rbck' archivelog all delete input;
backup current controlfile format '$RMAN_HOME/ctlfile/ctl_%d_%T_%s_%p_%t.rbck';
crosscheck backup;
delete noprompt expired backup;
release channel c1;
release channel c2;
release channel c3;
release channel c4;
release channel c5;
}
exit;
EOF
echo "backup_incr1 finish! check in :" ${RMANLOG} >
> ${LOGFILE}
echo "backup_incr1 end time:" `date +%Y-%m-%d_%H:%M:%S` >> ${LOGFILE}
echo "-------------------------------incr1_end-----------------------------------" >> ${LOGFILE}
#end of file
echo "Incremental 1 backup complete,your backup are in $RMAN_HOME"
}
case "$cmd" in
--help)
print_help
;;
-h)
print_help
;;
--h)
print_help
;;
--full)
full
;;
--incr0)
incr0
;;
--incr1)
incr1
;;
esac