0

I have over 900 Oracle strings in the following format:

sqlplus (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=c)(PORT=a))(CONNECT_DATA=(SID=b)))

Can I create a batch file to test all 900 together using DOS? I do not want to test each manually. Getting the version will be helpful too. Appreciate your help.

3
  • Could you install cygwin? Should you use the cmmand prompt only? Commented Oct 4, 2016 at 20:22
  • By "DOS" you are actually talking about the Windows command prompt cmd, I guess... Commented Oct 4, 2016 at 20:30
  • There is no current Oracle client that runs on DOS. They all require at least Windows to run. So, no you can't do that in DOS - but you can do it in the Windows command line. Commented Oct 4, 2016 at 21:23

1 Answer 1

0

You can read a file line by line (source) and use it as a argument like this:

for /f "tokens=*" %%a in (alias.txt) do call :processline %%a

:processline
tnsping %*
goto :eof

:eof

You might need to use the trick from Checking if the output is OK to check if connection is ok or not.

I would prefer tnsping over sqlplus, so you do not have to worry about username, password and actual command to execute.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.