ITPub博客

首页 > Linux操作系统 > Linux操作系统 > rman backup script(引用)

rman backup script(引用)

原创 Linux操作系统 作者:tolilong 时间:2012-06-07 08:45:21 0 删除 编辑
某Oracle真实RMAN备份脚本和策略分享:

【自动作业 crontab 内容】
#* * * * * /oradata3/oracle/rman/rman1
#10 10 03 * * /oradata3/oracle/rman/rman0
#20 10 * * 6 /oradata3/oracle/rman/rman1
20 10 * * 6 /oradata3/oracle/rman/rman0bak
#00 01 * * 0,1,2,3,4,5 /oradata3/oracle/rman/rman2

【各脚本】
more /oradata3/oracle/rman/rman1
rman target / log=/oradata4/oracle/rman/$(date +%y%m%d%H%M)backup1.log < delete noprompt obsolete;
run
{
allocate channel d1 device type disk;
backup incremental level 1
format '/oradata4/oracle/rman/%d_%s_%p.bak_1'
(database include current controlfile filesperset=2 );
sql 'alter system archive log current';
backup archivelog all format '/oradata4/oracle/rman/arc_%s_%p.bk_1' delete all input;
}
EOF

more /oradata3/oracle/rman/rman0
rman target / log=/oradata3/oracle/rman/$(date +%y%m%d%H%M)backup0.log < run
{
backup incremental level 0
format '/oradata3/oracle/rman/%d_%s_%p.bak_0'
(database include current controlfile filesperset=2 );
sql 'alter system archive log current';
backup archivelog all format '/oradata3/oracle/rman/arc_%s_%p.bk_0' delete all input;
}
delete noprompt obsolete;
EOF
exit

more /oradata3/oracle/rman/rman1
rman target / log=/oradata4/oracle/rman/$(date +%y%m%d%H%M)backup1.log < delete noprompt obsolete;
run
{
allocate channel d1 device type disk;
backup incremental level 1
format '/oradata4/oracle/rman/%d_%s_%p.bak_1'
(database include current controlfile filesperset=2 );
sql 'alter system archive log current';
backup archivelog all format '/oradata4/oracle/rman/arc_%s_%p.bk_1' delete all input;
}
EOF
exit

more /oradata3/oracle/rman/rman0bak
rman target / log=/oradata3/oracle/rman/$$(date +%y%m%d%H%M)backup0.log < run
{
backup incremental level 0 database filesperset=3;
sql 'alter system switch logfile';
backup archivelog all delete all input;
delete noprompt obsolete;
}
EOF
exit

more /oradata3/oracle/rman/rman2
rman target / log=/oradata3/oracle/rman/$(date +%y%m%d%H%M)backup2.log < delete noprompt obsolete;
run
{
allocate channel d1 device type disk;
backup incremental level 2 tag 'db_2'
format '/oradata3/oracle/rman/%d_%s_%p.bak_2'
(database include current controlfile filesperset=2 );
sql 'alter system archive log current';
backup archivelog all format '/oradata3/oracle/rman/arc_%s_%p.bk_2' delete all input;
}
EOF
exit


RMAN> show all;
using target database control file instead of recovery catalog
RMAN configuration parameters are:
CONFIGURE RETENTION POLICY TO REDUNDANCY 1;
CONFIGURE BACKUP OPTIMIZATION OFF; # default
CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default
CONFIGURE CONTROLFILE AUTOBACKUP ON;
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '/oradata3/orabak/rman/%F';
CONFIGURE DEVICE TYPE DISK PARALLELISM 4 BACKUP TYPE TO COMPRESSED BACKUPSET;
CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE CHANNEL 1 DEVICE TYPE DISK FORMAT '/oradata3/orabak2/rman/%d_%T%t%p';
CONFIGURE CHANNEL 2 DEVICE TYPE DISK FORMAT '/oradata3/orabak1/rman/%d_%T%t%p';
CONFIGURE CHANNEL 3 DEVICE TYPE DISK FORMAT '/oradata5/oracle/rman1/%d_%T%t%p';
CONFIGURE CHANNEL 4 DEVICE TYPE DISK FORMAT '/oradata5/oracle/rman2/%d_%T%t%p';
CONFIGURE MAXSETSIZE TO UNLIMITED; # default
CONFIGURE ENCRYPTION FOR DATABASE OFF; # default
CONFIGURE ENCRYPTION ALGORITHM 'AES128'; # default
CONFIGURE ARCHIVELOG DELETION POLICY TO NONE; # default
CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/opt/oracle/oracle/product/10.2.0/db_1/dbs/snapcf_bix.f'; # default

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/24237320/viewspace-732102/,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2010-07-13

  • 博文量
    406
  • 访问量
    963389