oracle RMAN 全备(0级)
创建Oracle RMAN全备的脚本,定时每天2:30执行,相关文件夹已先创建。
#创建rman_bak_level0.sh文件$ vi rman_bak_level0.sh
#!/bin/bash
source /home/oracle/.bash_profile
$ORACLE_HOME/bin/rman target / nocatalog msglog=/oradata/rmanBackup/rman_`date +%F`.log << EOF_RMAN
run {
backup format '/oradata/rmanBackup/DB_inc0_%d_%T_%s' as compressed backupset incremental level 0 database plus archivelog delete all input;
backup current controlfile format '/oradata/rmanBackup/con_bak_%d_%T_%s';
crosscheck backup;
delete noprompt expired backup;
report obsolete;
delete noprompt obsolete;
}
#end
更改文件权限
$ chmod +x /orabak/rman_bak_level0.sh
创建定时
$ crontab -e
30 2 * * * sh /orabak/rman_bak_level0.sh