[oracle@primary ~]$ vi /data/backup.sh
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1
export ORACLE_SID=orcl
export PATH=$PATH:$HOME/bin:$ORACLE_HOME/bin
rman target / nocatalog msglog /data/flash_recovery_area/backup.log append
crosscheck backupset;
delete noprompt expired backupset;
ALLOCATE CHANNEL ch00 TYPE DISK;
BACKUP
full
FORMAT '/data/flash_recovery_area/bk_%s_%p_%d_%T.bk'
DATABASE;
sql 'alter system archive log current';
RELEASE CHANNEL ch00;
}
EOF
#####################################################
[oracle@primary ~]$ crontab -l
23 15 * * * sh /data/backup.sh
[oracle@primary ~]$ crontab -e
23 15 * * * sh /data/backup.sh
###########################################################
$rman target /
RMAN>backup full format '/data/%U’ database;
RMAN> backup device type disk format '/data/%U' database plus archivelog;
RMAN> backup device type disk format '/data/%U' current controlfile for Standby;