一、增量备份脚本
0级备份脚本:红色部分为自定义的备份文件放置的目录
复制代码 代码如下:
#script.:BackupFull.sh
#creater:xyh
#date:2014-03-08
#desc:backup full database datafile in archive with rman
#connect database
export ORACLE_BASE=/u01/app/oracle
export ORACLE_SID=orcl
export ORACLE_HOME=/u01/app/oracle/product/10.2.0/db_1
export PATH=$ORACLE_HOME/bin:$PATH
rman target/ << EOF_RMAN
run{
allocate channel c1 type disk;
backup incremental level 0 tag 'db0' format
'/home/oracle/RmanBackup/db0_%d_%T_%s' database include current controlfile;
sql 'alter system archive log current';
backup filesperset 5 format '/home/oracle/RmanBackup/cf0_%d_%T_%s' archivelog all delete input;
#filesperset 5表示备份集里面最多包含5个文件
delete noprompt obsolete;
release channel c1;
}
# end
1级备份脚本
复制代码 代码如下:
#script.:Incrl.sh
#creater:xyh
#date:2014-03-08
#desc:backup full database datafile in archive with rman
#connect database
export ORACLE_BASE=/u01/app/oracle
export ORACLE_SID=orcl
export ORACLE_HOME=/u01/app/oracle/product/10.2.0/db_1
export PATH=$ORACLE_HOME/bin:$PATH
rman target/ << EOF_RMAN
run{
allocate channel c1 type disk;
backup incremental level 1 tag 'db1' format
'/home/oracle/RmanBackup/db1_%d_%T_%s' database include current controlfile;
sql 'alter system archive log current';
backup filesperset 5 format '/home/oracle/RmanBackup/cf1_%d_%T_%s' archivelog all delete input;
#filesperset 5表示备份集里面最多包含5个文件
delete noprompt obsolete;
release channel c1;
}
#end
二、使用linux的crontab设置自动执行备份
复制代码 代码如下:
crontab -e
按Enter后,可以像vi编辑器一样输入下面内容
复制代码 代码如下:
0 1 * * 0 /home/oracle/BackupFull.sh /home/oracle/BackupFull.log
0 1 * * 3 /home/oracle/BackupFull.sh /home/oracle/BackupFull.log
30 1 * * 1-2 /home/oracle/Incrl.sh /home/oracle/Incr.log
30 1 * * 4-6 /home/oracle/Incrl.sh /home/oracle/Incr.log
查看crontab内容:crontab -l
注:上面意思是把全库备份日志写到/home/oracle/BackupFull.log文件中,而增量备份日志写到/home/oracle/Incr.log中
周日和周三凌晨1:00执行0级全库备份,周一、二、四、五、六凌晨1:30执行增量备份
免责声明:本站资源来自互联网收集,仅供用于学习和交流,请遵循相关法律法规,本站一切资源不代表本站立场,如有侵权、后门、不妥请联系本站删除!
更新日志
- 小骆驼-《草原狼2(蓝光CD)》[原抓WAV+CUE]
- 群星《欢迎来到我身边 电影原声专辑》[320K/MP3][105.02MB]
- 群星《欢迎来到我身边 电影原声专辑》[FLAC/分轨][480.9MB]
- 雷婷《梦里蓝天HQⅡ》 2023头版限量编号低速原抓[WAV+CUE][463M]
- 群星《2024好听新歌42》AI调整音效【WAV分轨】
- 王思雨-《思念陪着鸿雁飞》WAV
- 王思雨《喜马拉雅HQ》头版限量编号[WAV+CUE]
- 李健《无时无刻》[WAV+CUE][590M]
- 陈奕迅《酝酿》[WAV分轨][502M]
- 卓依婷《化蝶》2CD[WAV+CUE][1.1G]
- 群星《吉他王(黑胶CD)》[WAV+CUE]
- 齐秦《穿乐(穿越)》[WAV+CUE]
- 发烧珍品《数位CD音响测试-动向效果(九)》【WAV+CUE】
- 邝美云《邝美云精装歌集》[DSF][1.6G]
- 吕方《爱一回伤一回》[WAV+CUE][454M]