#!/bin/bash
Date=`date +'%Y%m%d%H%M%S'`
Log=$Date.log
/bin/sh /home/oracle/rman_scripts/rman_hles01_lv0.sh > /home/oracle/rman_logs/hles01/$Log
#!/bin/bash
#incremental level 0 backup script
export ORACLE_SID=hles011
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=/u01/app/oracle/product/11.2.0.4/dbhome_1
export PATH=$ORACLE_HOME/bin:$ORACLE_HOME/OPatch:$PATH
rman target / <<EOF
run{
allocate channel ch1 type disk;
allocate channel ch2 type disk;
allocate channel ch3 type disk;
allocate channel ch4 type disk;
backup as compressed backupset incremental level=0 database include current controlfile tag='rman_lv0';
sql 'alter system archive log current';
backup as compressed backupset archivelog all tag='arch_lv0' delete all input;
crosscheck backup;
delete noprompt obsolete;
delete noprompt expired backup;
crosscheck archivelog all;
delete noprompt expired archivelog all;
release channel ch1;
release channel ch2;
release channel ch3;
release channel ch4;
}
exit
EOF
30 0 * * 7 /bin/sh /home/oracle/rman_scripts/lv0_rman_hles03.sh
30 0 * * 1 /bin/sh /home/oracle/rman_scripts/lv1_rman_hles03.sh
30 0 * * 2 /bin/sh /home/oracle/rman_scripts/lv1_rman_hles03.sh
30 0 * * 3 /bin/sh /home/oracle/rman_scripts/lv1_rman_hles03.sh
30 0 * * 4 /bin/sh /home/oracle/rman_scripts/lv1_rman_hles03.sh
30 0 * * 5 /bin/sh /home/oracle/rman_scripts/lv1_rman_hles03.sh
30 0 * * 6 /bin/sh /home/oracle/rman_scripts/lv1_rman_hles03.sh
30 12 * * * find /home/oracle/rman_logs -name '20*.log' -mtime +30 -exec rm {} \;
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/30338315/viewspace-2135338/
,如需转载,请注明出处,否则将追究法律责任。