首页 > 数据库 > mysql教程 > Windows下的Oracle导出脚本

Windows下的Oracle导出脚本

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
发布: 2016-06-07 14:53:23
原创
1302 人浏览过

REM File name Daily.bat REM Batch Process Reload DB Backup REM REM Author Frank.Fan REM Modification History Created 2012-05-07 REM Modified REM for /F tokens=1-3 delims=/ %%i in ('date /t') do @set FILENAMEDT=%%i%%j%%k #取系统当前日期:

  REM File name Daily.bat

  REM Batch Process

  Reload DB Backup

  REM

  REM Author Frank.Fan

  REM Modification History

  Created 2012-05-07

  REM Modified

  REM

  for /F "tokens=1-3 delims=/ " %%i in ('date /t') do @set FILENAMEDT=%%i%%j%%k

  #取系统当前日期:年月日(中文格式)、月日年(英文格式)

  for /F "tokens=1,2 delims=: " %%i in ('time /t') do @set FILENAMETM=%%i%%j

  #取系统当前时间:时分

  SET USERNAME=SYSTEM #oracle帐号

  SET USERPASSWD=123456 #oracle密码

  SET SERVICENAME=QEWAY #oracle SID

  SET SCHEMASNAME=ISCOP #oracle SCHEMA帐号

  SET RARTOOL=C:Program FilesWinRAR #设定WINRAR路径(各个机器不同)

  SET DBBACKUPPATH=D:DBBAK #设定被导出的文件路径

  SET DBADIRECTORIES=DBBAK #oracle内设置的Directory目录名

  SET DBBACKUPFILENAME=QEWAY_%FILENAMEDT%-%FILENAMETM%

  goto main

  :main

  ECHO Exporting schemas.......

  expdp %USERNAME%/%USERPASSWD%@%SERVICENAME% DUMPFILE=�ADIRECTORIES%:�BACKUPFILENAME%.dmp schemas=%SCHEMASNAME% LOGFILE=�ADIRECTORIES%:�BACKUPFILENAME%.log

  ECHO Done exporting schemas.

  ECHO =======================================================

  ECHO ...Done export

  if exist �BACKUPPATH%�BACKUPFILENAME%.RAR del �BACKUPPATH%�BACKUPFILENAME%.RAR

  "%RARTOOL%winrar.exe" a -ep �BACKUPPATH%�BACKUPFILENAME%.RAR �BACKUPPATH%�BACKUPFILENAME%.dmp

  del �BACKUPPATH%�BACKUPFILENAME%.dmp

  Echo ...Compression complete

  forfiles /p "�BACKUPPATH%" /m *.rar -d -30 /c "cmd /c del /f @path"

  #删除30天之前的RAR文件

  REM -----------Send a mail to notification-----------

  start D:DBBAKBatch_notification_Daily.vbs #调用邮件通知VBS文件

  EXIT

  邮件通知VBS文件内容:

  NameSpace = ""

  set Email = CreateObject("CDO.Message")

  Email.From = "XXXX@Exchange.com"

  Email.To = "XXXX@163.com"

  Email.Subject = "Gongxtpt Batch Daily Task"

  Email.Textbody = "Gongxtpt Batch Daily Task was done!! Starting at 00:00AM"

  with Email.Configuration.Fields

  .Item(NameSpace&"sendusing") = 2

  .Item(NameSpace&"smtpserver") = "10.0.0.12"

  .Item(NameSpace&"smtpserverport") = 25

  .Item(NameSpace&"smtpauthenticate") = 0

  .Item(NameSpace&"sendusername") = ""

  .Item(NameSpace&"sendpassword") = ""

  .Update

  end with

  Email.Send

  Set Email=Nothing

相关标签:
来源:php.cn
本站声明
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn
最新问题
windows版有emmet吗??
来自于 1970-01-01 08:00:00
0
0
0
Windows可以学习吗
来自于 1970-01-01 08:00:00
0
0
0
windows环境安装PHP
来自于 1970-01-01 08:00:00
0
0
0
windows下的zookeeper扩展
来自于 1970-01-01 08:00:00
0
0
0
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板