From b2449b1700e54d63dc147aaa0375a60e09d7d7a3 Mon Sep 17 00:00:00 2001 From: hardya Date: Wed, 18 Jun 2008 09:37:33 +0000 Subject: [PATCH] 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 --- WebServer/DatabaseScripts/expdp_task.cmd | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) 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%