Page 1 of 1

TOraSession Ping method

Posted: Tue 20 Nov 2012 20:03
by jjeffman
Hello.

The documentation have not mentioned how TOraSession::Ping() method works. I do not know if I am doing something wrong but it seems that the Ping method needs username and password to work properly. :(

I was wondering if the Ping method is the right way to check if the Oracle server is available without actually making a connection to the database as the Oracle TNSPING does. :idea:

Thank you very much.

Jayme Jeffman Filho

Re: TOraSession Ping method

Posted: Wed 21 Nov 2012 10:59
by AlexP
Hello,

tnsping is a separate command-line utility which checks only the availability of the listener. In ODAC we use the OCIPing method from the oci.dll library for Oracle Client since version 10.2, and execution of an "empty" PL/SQL block for older clients, so to call this method, connection should be established.

Re: TOraSession Ping method

Posted: Wed 21 Nov 2012 12:19
by jjeffman
Thank you very much for answering.

Is there any way of doing the same as TNSPING ?

I would like to get the same Oracle error messages that TNSPING raises when the listener is not available to the client.

Thank you very much.

Best regards.

Jayme Jeffman Filho

Re: TOraSession Ping method

Posted: Wed 21 Nov 2012 14:26
by AlexP
Hello,

You can use methods CreateProcess, ShellExecute, etc. to call tnsping