rman备份脚本:

#!/bin/bash
source /home/oracle/.bash_profile

rman target / << EOF
run {
allocate channel ch1 type disk;
allocate channel ch2 type disk;
backup incremental level 0 database include current controlfile plus archivelog delete all input;
release channel ch1;
release channel ch2;
}
quit;
EOF

crontab设置自动任务:

$crontab -l

0 1 * * * /home/oracle/backup.sh >> /home/oracle/backup.log