Files
mip/WebServer/DatabaseScripts/expdp_task.cmd
hardya b2449b1700 expdp_task.cmd:
Correction to routines determining dates and times.
Attempt to run the zip process at a low priority to reduce impact on the system.

git-svn-id: http://locode01.ad.dom/svn/WEBMIP/trunk@5340 248e525c-4dfb-0310-94bc-949c084e9493
2008-06-18 09:37:33 +00:00

32 lines
983 B
Batchfile

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
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
cmd /c /wait "start /low zip %zipfile% %dmpfile% %logfile%"
mkdir %destdir%
move /Y %zipfile% %destdir% && erase %dmpfile%