linux自动运行rman增量备份脚本建站知识
导读:1建站知识这篇文章主要介绍了linux自动运行rman增量备份脚本,实现周日和周三凌晨1:00执行0级全库备份,周一、二、四、五、六企业网站建设网站seo优化培训。
一、增量备份脚本0级备份脚本:红色部分为自定义的备份文件放置的目录
复制代码 代码如下:
#script.:BackupFull.sh#creater:xyh#date:2014-03-08#desc:backup full database datafile in archive with rman#connect databaseexport ORACLE_BASE=/u01/app/oracleexport OR百度seo网站优化ACLE_SID=orclexport ORACLE_HOME=/u01/app/oracle/product/10.2.0/db_1export PATH=$ORACLE_HOME/bin:$PATHrman target/ << EOF_RMANrun{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/Rm建设网站anBackup/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 databaseexport ORACLE_BASE=/u01/app/oracleexport ORACLE_SID=orclexport ORACLE_HOME=/u01/app/oracle/product/10.2.0/db_1export PATH=$ORACLE_HOME/bin:$PATHrman target/ << EOF_RMANrun{allocate channel c1 type disk;backup incremental level 1 tag 'db1' format'/home/ora网站建设cle/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.log0 1 * * 3 /home/oracle/BackupFull.sh >>/home/oracle/BackupFull.log30 1 * * 1-2 /home/oracle/Incrl.sh >>/home/oracle/Incr.log30 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执行增量备份相关企业网站建设网站seo优化培训。声明: 本文由我的SEOUC技术文章主页发布于:2023-05-22 ,文章linux自动运行rman增量备份脚本建站知识主要讲述增量,脚本,linux自动运行rman增量备份脚本建站知识网站建设源码以及服务器配置搭建相关技术文章。转载请保留链接: https://www.seouc.com/article/web_4496.html