#!/bin/sh
source /home/oracle/.bash_profile
DICPATH=/oafile/archlog
LOGPATH=$DICPATH/backuplog
DATPATH=$DICPATH/backup
rman target / nocatalog msglog=$LOGPATH/rman_db_`date '+%Y%m%d%H%M%S'`.log <<EOF
#rman target sys/c21nzhxg24cd@20.1.1.11/c2db1.19pay.com nocatalog msglog=$LOGPATH/rman_db_`date '+%Y%m%d%H%M%S'`.log <<EOF
run{
REPORT OBSOLETE;
crosscheck archivelog all;
DELETE force NOPROMPT OBSOLETE;
allocate channel c1 type disk;
allocate channel c2 type disk;
allocate channel c3 type disk;
allocate channel c4 type disk;
backup as compressed backupset full database tag 'dbfull' format '$DATPATH/dbfull_%u_%s_%p' ;
sql 'alter system archive log current';
backup as compressed backupset filesperset 3 archivelog all tag 'arch' format '$DATPATH/arch_%u_%s_%p' delete input;
backup current controlfile tag 'ctl' format '$DATPATH/ctl_%s_%p_%t';
release channel c1;
release channel c2;
release channel c3;
release channel c4;
DELETE force NOPROMPT OBSOLETE;
}
exit;
EOF
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/16976507/viewspace-2132431/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/16976507/viewspace-2132431/