a我考网

 找回密码
 立即注册

QQ登录

只需一步,快速开始

扫一扫,访问微社区

查看: 92|回复: 0

[考试辅导] Oracle备份脚本

[复制链接]
发表于 2012-8-4 14:06:19 | 显示全部楼层 |阅读模式
题记:这里分享一下我们oracle的备份脚本,这些脚本均在生产库运行,正确无误!   环境:SUSE linux 10sp2 + oracle 11gr1说明:小型库一般都是每周做一次全备,大型库每周也做一次全备外,周三做1级增量备份,然后每天晚上都做一次2级增量备份,归档日志每天分不同时段定时备份!- T+ x* x* c9 K: o' T/ A
  小型库全备:run { # Hot database level 0 whole backup allocate channel t1 type disk;backup incremental level 0 skip inaccessible format '/backup/osedb_osedb01/data/back_%s_%p_%T_%d' #AS COMPRESSED backupset database plus archivelog format '/backup/osedb_osedb01/arch/arclogback_%s_%p_%t_%d' delete input;delete obsolete;release CHANNEL t1 ;}
( H& y! J+ L. {4 |  大库全备:oracle@subsdb1:~/bin/incre_bakup_cmd> cat backup_db_level0.cmd run { # Hot database level 0 whole backup allocate channel t1 type disk maxpiecesize=50G;allocate channel t2 type disk maxpiecesize=50G;allocate channel t3 type disk maxpiecesize=50G;backup as compressed backupset incremental level 0 tag 'subsdb_level0' skip inaccessible format '/backup/subsdb_subsdb1/data/bak_%d_%T_%s_%p_db_level0' #AS COMPRESSED backupset database plus archivelog format '/backup/subsdb_subsdb1/arch/arclogback_%s_%p_%t_%d' delete input;backup current controlfile format '/backup/subsdb_subsdb1/data/bak_%d_%T_%s_ctl.ctl';release channel t1;release channel t2;release channel t3;delete noprompt obsolete;} 1级增量备份:oracle@subsdb1:~/bin/incre_bakup_cmd> cat backup_db_level1.cmd run { # Hot database level 1 whole backup allocate channel t1 type disk maxpiecesize=50G;allocate channel t2 type disk maxpiecesize=50G;allocate channel t3 type disk maxpiecesize=50G;backup as compressed backupset incremental level 1 tag 'subsdb_level1' skip inaccessible format '/backup/subsdb_subsdb1/data/bak_%d_%T_%s_%p_db_level1' #AS COMPRESSED backupset database plus archivelog format '/backup/subsdb_subsdb1/arch/arclogback_%s_%p_%t_%d' delete input;backup current controlfile format '/backup/subsdb_subsdb1/data/bak_%d_%T_%s_ctl.ctl';release channel t1;release channel t2;release channel t3;delete noprompt obsolete;} 2级增量备份:oracle@subsdb1:~/bin/incre_bakup_cmd> cat backup_db_level2.cmd run { # Hot database level 2 whole backup allocate channel t1 type disk maxpiecesize=50G;allocate channel t2 type disk maxpiecesize=50G;allocate channel t3 type disk maxpiecesize=50G;backup as compressed backupset incremental level 2 tag 'subsdb_level2' skip inaccessible format '/backup/subsdb_subsdb1/data/bak_%d_%T_%s_%p_db_level2' #AS COMPRESSED backupset database plus archivelog format '/backup/subsdb_subsdb1/arch/arclogback_%s_%p_%t_%d' delete input;backup current controlfile format '/backup/subsdb_subsdb1/data/bak_%d_%T_%s_ctl.ctl';release channel t1;release channel t2;release channel t3;delete noprompt obsolete;}
: j9 J1 u" F" t5 r4 \0 m  归档日志备份:cat backup_arch.cmd run { allocate channel t1 type disk;backup skip inaccessible format '/backup/osedb_osedb01/arch/arclogback_%s_%p_%t_%d' #AS COMPRESSED backupset(archivelog all delete input);delete obsolete;release CHANNEL t1 ;}
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|Woexam.Com ( 湘ICP备18023104号 )

GMT+8, 2024-5-7 13:13 , Processed in 0.313456 second(s), 21 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表