辅导:oracle增量备份脚本
来源:优易学  2011-9-28 14:24:51   【优易学:中国教育考试门户网】   资料下载   IT书店
 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集合到一个文件夹下面

责任编辑:小草

文章搜索:
 相关文章
热点资讯
热门课程培训