Incremental and full backup solutions for Oracle

Time:2020-8-12

catalog
  • Oracle production backup solution
    • Crontab configuration
    • rman_backup_0.sh
    • rman_backup_1.sh

Oracle production backup solution

Crontab configuration

Full backup on weekends, incremental backup on other days, and clear files 15 days ago

0 5 * * * find /app/oracle11g/product/11.2.0/archdir/ecudb/* -mtime +6 |xargs  rm -fr

#rmanbackup
30 4 * * 6  sh /backup/feikong/scripts/rman_backup_0.sh
30 4 * * 0,1,2,3,4,5  sh /backup/feikong/scripts/rman_backup_1.sh
30 4 * * * find /backup/data -ctime +15 -type f |grep -E "DB_0|DB_1|arch_" |xargs -L 1 rm -rf

rman_backup_0.sh

#!/bin/bash
source ~/.bash_profile
rq=`date +%Y%m%d`
rman target / log /backup/log/rmanbackup_${rq}.log append<

rman_backup_1.sh

#!/bin/bash
source ~/.bash_profile
rq=`date +%Y%m%d`
rman target / log /backup/log/rmanbackup_${rq}.log append<