-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdmdump.bat
More file actions
39 lines (31 loc) · 935 Bytes
/
dmdump.bat
File metadata and controls
39 lines (31 loc) · 935 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
@echo off
REM Arguments
set EXPECTED_ARGS=1
set LIB_DIR=%~dp0
IF "%LIB_DIR:~-1%"=="\" SET LIB_DIR=%LIB_DIR:~0,-1%
set CONN_STR=%1
REM Count the number of passed in args
set ARGS_CNT=0
for %%x in (%*) do Set /A ARGS_CNT+=1
REM Make sure the correct number of arguments were received
if %ARGS_CNT% neq %EXPECTED_ARGS% (
echo "Wrong number of args; Received $#; Expected %EXPECTED_ARGS%"
call:print_usage
goto:eof
)
REM Warn if TNS_ADMIN is not set.
if "%TNS_ADMIN%"=="" (
echo "WARNING: For TNS connections, the TNS_ADMIN environment variable must be set to the directory containing TNSNAMES.ora"
)
echo "INPUT:"
echo CONN_STR:%CONN_STR%
echo exit | sql -L %CONN_STR% @%LIB_DIR%/scriptWrap %LIB_DIR%
echo "Finished"
goto:eof
:print_usage
echo "dmdump connect_string"
echo "connect_string format can be:"
echo " hr/hr@//server:port/service_name"
echo " hr/hr@//server:port:sid"
echo " hr/hr@TNSNAME"
goto:eof