Thursday, November 27, 2008

DB - Export Oracle DB Script

@echo off
SETLOCAL

Set USERNAME=userid
Set PASSWORD=ps
Set SID=ARTD
Set OUTPUT_FILE=outdat

@rem Check all value exist before we start the process

if "%USERNAME%" == "" goto formaterror
if "%PASSWORD%" == "" goto formaterror
if "%SID%" == "" goto formaterror
if "%OUTPUT_FILE%" == "" goto formaterror

goto process

:formaterror
echo Usage: export [username] [password] [sid] [output_filename]
@echo off
goto finish

:process
exp %USERNAME%/%PASSWORD%@%SID% file=%OUTPUT_FILE%.dmp log=%USERNAME%exp.log owner=%USERNAME%

:finish

ENDLOCAL

No comments: