当前所在位置:珠峰网资料 >> 计算机 >> Oracle认证 >> 正文
2015年Oracle认证考试辅导:oracle增量备份脚本
发布时间:2010/3/13 11:40:58 来源:城市学习网 编辑:MOON
  oracle 增量备份脚本
  OS :RHEL AS 4 oracle 10g
  0备份脚本
  #!/bin/bash
  # incremental level 0 backup script
  source /home/oracle/.bash_profile
  current_day=`date +%Y%m%d`
  mkdir /home/oracle/RMANBACKUP/$current_day
  rman target / EOF
  run
  {
  CONFIGURE CONTROLFILE AUTOBACKUP ON;
  CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO ‘/home/oracle/RMANBACKUP/$current_day/PID-%F‘;
  allocate channel dev1 type disk;
  allocate channel dev2 type disk;
  allocate channel dev3 type disk;
  backup incremental level 0 tag=‘db0‘
  format ‘/home/oracle/RMANBACKUP/$current_day/%n_%T_%U‘ database;
  sql ‘alter system archive log current‘;
  backup archivelog all format ‘/home/oracle/RMANBACKUP/$current_day/arc_%n_%T_%U‘ delete all input;
  release channel dev1;
  release channel dev2;
  release channel dev3;
  }
  EOF
  1级累积增量脚本
  #!/bin/bash
  # incremental level 1 backup script
  source /home/oracle/.bash_profile
  current_day=`date +%Y%m%d`
  incr_day=incr$current_day
  mkdir /home/oracle/RMANBACKUP/$incr_day
  rman target / EOF
  run
  {
  CONFIGURE CONTROLFILE AUTOBACKUP ON;
  CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO ‘/home/oracle/RMANBACKUP/$incr_day/PID-%F‘;
  allocate channel dev1 type disk;
  allocate channel dev2 type disk;
  allocate channel dev3 type disk;
  backup incremental level 1 cumulative tag=‘db1‘
  format ‘/home/oracle/RMANBACKUP/$incr_day/%n_%T_%U‘ database;
  sql ‘alter system archive log current‘;
  backup archivelog all format ‘/home/oracle/RMANBACKUP/$incr_day/arc_%n_%T_%U‘ delete all input;
  release channel dev1;
  release channel dev2;
  release channel dev3;
  }
  EOF
  每天RMAN出来的backup set集合到一个文件夹下面
广告合作:400-664-0084 全国热线:400-664-0084
Copyright 2010 - 2017 www.my8848.com 珠峰网 粤ICP备15066211号
珠峰网 版权所有 All Rights Reserved