oracle增量和全量备份方案
2021/6/21 2:26:18
本文主要是介绍oracle增量和全量备份方案,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!
oracle增量和全量备份方案
目录
- oracle生产备份方案
- crontab 配置
- rman_backup_0.sh
- rman_backup_1.sh
oracle生产备份方案
crontab 配置
周末全量备份,其他日期增量备份,清除15天以前文件
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<<EOF set encryption on identified by "u9j04hkUvfRu" only; run{ ALLOCATE CHANNEL ch1 TYPE disk; ALLOCATE CHANNEL ch2 TYPE disk; BACKUP INCREMENTAL LEVEL 0 TAG "DB0" DATABASE FORMAT "/backup/data/DB_0_%T%U.bkp"; CROSSCHECK ARCHIVELOG ALL; DELETE NOPROMPT EXPIRED ARCHIVELOG ALL; sql "alter system archive log current"; backup archivelog all format "/backup/data/arch_%T%U.arc"; delete noprompt backup of archivelog until time "sysdate-8"; backup current controlfile format "/backup/data/ctl_%T%U.ctl"; CROSSCHECK BACKUP; CROSSCHECK backupset; DELETE NOPROMPT EXPIRED BACKUP; DELETE NOPROMPT EXPIRED BACKUPSET; REPORT OBSOLETE; delete NOPROMPT obsolete device type disk; RELEASE CHANNEL ch1; RELEASE CHANNEL ch2; } exit EOF
rman_backup_1.sh
#!/bin/bash source ~/.bash_profile rq=`date +%Y%m%d` rman target / log /backup/log/rmanbackup_${rq}.log append<<EOF set encryption on identified by "u9j04hkUvfRu" only; run{ ALLOCATE CHANNEL ch1 TYPE disk; ALLOCATE CHANNEL ch2 TYPE disk; BACKUP INCREMENTAL LEVEL 1 TAG "DB1" DATABASE FORMAT "/backup/data/DB_1_%T%U.bkp"; CROSSCHECK ARCHIVELOG ALL; DELETE NOPROMPT EXPIRED ARCHIVELOG ALL; sql "alter system archive log current"; backup archivelog all format "/backup/data/arch_%T%U.arc"; delete noprompt backup of archivelog until time "sysdate-8"; backup current controlfile format "/backup/data/ctl_%T%U.ctl"; CROSSCHECK BACKUP; CROSSCHECK backupset; DELETE NOPROMPT EXPIRED BACKUP; DELETE NOPROMPT EXPIRED BACKUPSET; REPORT OBSOLETE; delete NOPROMPT obsolete device type disk; RELEASE CHANNEL ch1; RELEASE CHANNEL ch2; } exit EOF
这篇关于oracle增量和全量备份方案的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!
- 2024-11-23增量更新怎么做?-icode9专业技术文章分享
- 2024-11-23压缩包加密方案有哪些?-icode9专业技术文章分享
- 2024-11-23用shell怎么写一个开机时自动同步远程仓库的代码?-icode9专业技术文章分享
- 2024-11-23webman可以同步自己的仓库吗?-icode9专业技术文章分享
- 2024-11-23在 Webman 中怎么判断是否有某命令进程正在运行?-icode9专业技术文章分享
- 2024-11-23如何重置new Swiper?-icode9专业技术文章分享
- 2024-11-23oss直传有什么好处?-icode9专业技术文章分享
- 2024-11-23如何将oss直传封装成一个组件在其他页面调用时都可以使用?-icode9专业技术文章分享
- 2024-11-23怎么使用laravel 11在代码里获取路由列表?-icode9专业技术文章分享
- 2024-11-22怎么实现ansible playbook 备份代码中命名包含时间戳功能?-icode9专业技术文章分享