diff --git a/WebServer/DatabaseScripts/expdp_task.cmd b/WebServer/DatabaseScripts/expdp_task.cmd index e482e1b..199ef5b 100644 --- a/WebServer/DatabaseScripts/expdp_task.cmd +++ b/WebServer/DatabaseScripts/expdp_task.cmd @@ -1,3 +1,11 @@ +REM $Id:$ + +REM +REM Use Oracle data pump to export data, zip the dump file and then move it to the +REM backup directory. +REM + +REM Enable extensions so that mkdir can create intermediate directories as required VERIFY errors 2>nul SETLOCAL ENABLEEXTENSIONS IF ERRORLEVEL 1 echo Unable to enable extensions @@ -5,22 +13,18 @@ IF ERRORLEVEL 1 echo Unable to enable extensions set dmpbasedir=C:\oracle\admin\webmip\dpdump set dmpfile=%dmpbasedir%\webmip_data_expdp.dmp set logfile=%dmpbasedir%\webmip_data_expdp.log +Set destbasedir=S:\orabackup\webmip\DataPump +FOR /F "TOKENS=1-3 DELIMS=/ " %%A IN ('DATE /T') DO (SET yyyy=%%C&set mm=%%B&set dd=%%A) +FOR /F "TOKENS=1 DELIMS=:" %%T IN ('TIME /T') DO SET hr=%%T +Set destdir=%destbasedir%\%yyyy%-%mm% +Set zipfile=webmip_expdp_%yyyy%-%mm%-%dd%-%hr%.zip erase %dmpfile% erase %logfile% expdp 'sys/fmdidgad@webmip as sysdba' parfile=parfile_data.expdp -REM expdp 'sys/webmip@webmip as sysdba' parfile=parfile_nodata.expdp -Set destbasedir=S:\orabackup\webmip\DataPump -Set dd=%DATE:~0,2% -Set mm=%DATE:~3,2% -Set yyyy=%DATE:~6,4% -Set hr=%TIME:~0,2% -Set destdir=%destbasedir%\%yyyy%-%mm% -Set zipfile=webmip_expdp_%yyyy%-%mm%-%dd%-%hr%.zip - -zip %zipfile% %dmpfile% %logfile% +cmd /c /wait "start /low zip %zipfile% %dmpfile% %logfile%" mkdir %destdir%