[oracle@dh114db01 scripts]$ more 1.sh
export NLS_DATE_FORMAT='yyyymmdd hh24:mi:ss'
export ORACLE_SID=hxzydb1
export FILE=`date +%Y%m%d`
rman target / log=/expdp/data/$ORACLE_SID-$FILE.log <<EOF
run{
allocate channel ch1 type disk maxpiecesize 10G;
allocate channel ch2 type disk maxpiecesize 10G;
allocate channel ch3 type disk maxpiecesize 10G;
allocate channel ch4 type disk maxpiecesize 10G;
allocate channel ch5 type disk maxpiecesize 10G;
configure retention policy to recovery window of 3 days;
backup as compressed backupset database tag 'full_orarpt' format '/expdp/data/%d_%T_%U.bak';
backup current controlfile tag 'ctl_orarpt' format '/expdp/data/ctrl%d_%T_%U.bak';
backup spfile tag 'spfile_orarpt' format '/expdp/data/spfile%d_%T_%U.bak';
crosscheck backupset;
#DELETE noprompt ARCHIVELOG ALL COMPLETED BEFORE 'SYSDATE-1';
#delete noprompt archivelog all completed before 'trunc(sysdate)';
#delete noprompt expired backup;
#report obsolete;
#DELETE NOPROMPT OBSOLETE;
release channel ch1;
release channel ch2;
release channel ch3;
release channel ch4;
release channel ch5;
}
EOF
exit;
export NLS_DATE_FORMAT='yyyymmdd hh24:mi:ss'
export ORACLE_SID=hxzydb1
export FILE=`date +%Y%m%d`
rman target / log=/expdp/data/$ORACLE_SID-$FILE.log <<EOF
run{
allocate channel ch1 type disk maxpiecesize 10G;
allocate channel ch2 type disk maxpiecesize 10G;
allocate channel ch3 type disk maxpiecesize 10G;
allocate channel ch4 type disk maxpiecesize 10G;
allocate channel ch5 type disk maxpiecesize 10G;
configure retention policy to recovery window of 3 days;
backup as compressed backupset database tag 'full_orarpt' format '/expdp/data/%d_%T_%U.bak';
backup current controlfile tag 'ctl_orarpt' format '/expdp/data/ctrl%d_%T_%U.bak';
backup spfile tag 'spfile_orarpt' format '/expdp/data/spfile%d_%T_%U.bak';
crosscheck backupset;
#DELETE noprompt ARCHIVELOG ALL COMPLETED BEFORE 'SYSDATE-1';
#delete noprompt archivelog all completed before 'trunc(sysdate)';
#delete noprompt expired backup;
#report obsolete;
#DELETE NOPROMPT OBSOLETE;
release channel ch1;
release channel ch2;
release channel ch3;
release channel ch4;
release channel ch5;
}
EOF
exit;
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/26179376/viewspace-2123039/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/26179376/viewspace-2123039/