oralce rman备份脚本linux,Oracle生产环境RMAN备份脚本

本文分享了在SUSE Linux 10sp2环境下Oracle 11gR1数据库的备份策略。小型库每周进行一次全备,大型库除周全备外,周三进行1级增量备份,后续每日2级增量备份。归档日志则每日定时备份。脚本包括全备、1级和2级增量备份以及归档日志备份的详细内容。
摘要由CSDN通过智能技术生成

题记:这里分享一下我们Oracle的备份脚本,这些脚本均在生产库运行,正确无误!

环境:SUSE Linux 10sp2 + Oracle 11gR1

说明:小型库一般都是每周做一次全备,大型库每周也做一次全备外,周三做1级增量备份,然后每天晚上都做一次2级增量备份,归档日志每天分不同时段定时备份!

--------------------------------------分割线 --------------------------------------

推荐阅读:

--------------------------------------分割线 --------------------------------------

小型库全备:

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 ;

}

大库全备:

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;

}

归档日志备份:

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 ;

}

0b1331709591d260c1c78e86d0c51c18.png

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值