[oracle@oa script]$ vi rman_bk.sh
#!/bin/sh
source /home/oracle/.bash_profile
cd $ORACLE_HOME/bin
rman target / nocatalog msglog=/App/oracle/oadb_backup/log/rman_bk_`date '+%Y%m%d%H%M%S'`.log <<EOF
run{
REPORT OBSOLETE;
DELETE force NOPROMPT OBSOLETE;
allocate channel c1 type disk;
allocate channel c2 type disk;
allocate channel c3 type disk;
backup full database tag 'dbfull' format '/App/oracle/oadb_backup/data/dbfull_%u_%s_%p' ;
backup current controlfile tag 'ctl' format '/App/oracle/oadb_backup/data/ctl_%s_%p_%t';
sql 'alter system archive log current';
#crosscheck archivelog all;
backup filesperset 3 archivelog all tag 'arch' format '/App/oracle/oadb_backup/data/arch_%u_%s_%p' delete input;
release channel c1;
release channel c2;
release channel c3;
}
exit;
EOF