oracle full database backup

panpong發表於2017-01-13


#!/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/,如需轉載,請註明出處,否則將追究法律責任。

相關文章