Oracle自动冷备份脚本Oracle认证考试

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


  冷备份,就是关闭db,物理copy数据文件、日志文件、控制文件、归档文件。
  rem ***** COLDBACKUP ORACLE DATABASE ON WINDOWS NT *****
  set ShutDownFile=C:ShutDown.SQL
  echo connect internal/oracle >. %ShutDownFile%
  echo shutdown immediate >.>. %ShutDownFile%
  echo startup >.>. %ShutDownFile%
  echo shutdown normal >.>. %ShutDownFile%
  echo exit >.>. %ShutDownFile%
  rem ***** SHUTDOWN THE DATABASE *******
  set oracle_sid=dbprim
  svrmgrl @%ShutDownFile%
  net stop OracleStart%oracle_sid%
  net stop OracleService%oracle_sid%
  rem ***** SET BACKUP FILES DIRECTORY *****
  e:
  md oradb
  cd oradb
  md backups
  cd backups
  rem *****cold backup for "dbprim" database on 2009-3-17 10:56:40 ... *****
  rem ***** COPY FILES *****
  rem Redo logs
  copy C:ORACLE-DATAREDO03.LOG
  copy C:ORACLE-DATAREDO02.LOG
  copy C:ORACLE-DATAREDO01.LOG
  rem Datafile
  copy C:ORACLE-DATADBPRIMSYSTEM01.DBF
  copy C:ORACLE-DATADBPRIMUNDOTBS01.DBF
  copy C:ORACLE-DATADBPRIMSYSAUX01.DBF
  copy C:ORACLE-DATADBPRIMUSERS01.DBF
  copy C:ORACLE-DATADBPRIMEXAMPLE01.DBF
  copy C:ORACLE-DATADBPRIMORATBS.DBF
  6 rows 0selected
  rem Control files
  copy C:ORACLE-DATADBPRIMCONTROL01.CTL
  copy C:ORACLE-DATADBPRIMCONTROL02.CTL
  copy C:ORACLE-DATADBPRIMCONTROL03.CTL
  rem *********START UP DATABASE AND SERVICES********
  net start OracleService%oracle_sid%
  net start OracleStart%oracle_sid%
  set StartFile=C:start.SQL
  echo connect internal/oracle >. %StartFile%
  echo startup >.>. %StartFile%
  echo exit >.>. %StartFile%
  set oracle_sid=dbprim
  svrmgrl @%StartFile%
  del /Q %ShutDownFile%
  del /Q %StartFile%
  exit

相关文章


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