oracle增量备份脚本Oracle认证考试

文章作者 100test 发表时间 2009:07:16 19:31:28
来源 100Test.Com百考试题网


  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 0delete 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 0delete all input.
  release channel dev1.
  release channel dev2.
  release channel dev3.
  }
  EOF
  每天RMAN出来的backup set集合到一个文件夹下面

相关文章


教你删除Oracle数据库中重复没用的数据Oracle认证考试
通过SSIS执行Oracle参数查询Oracle认证考试
oracle增量备份脚本Oracle认证考试
在WINDOWS上安装ORACLERAC的注意事项Oracle认证考试
ORA00000,Oracle的0号错误Oracle认证考试
Oracle自动冷备份脚本Oracle认证考试
澳大利亚华人论坛
考好网
日本华人论坛
华人移民留学论坛
英国华人论坛