TOraSession Ping method

Discussion of open issues, suggestions and bugs regarding ODAC (Oracle Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
jjeffman
Posts: 84
Joined: Tue 09 Nov 2004 12:22
Location: Porto Alegre-Rio Grande do Sul - Brazil

TOraSession Ping method

Post by jjeffman » Tue 20 Nov 2012 20:03

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

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Re: TOraSession Ping method

Post by AlexP » Wed 21 Nov 2012 10:59

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.

jjeffman
Posts: 84
Joined: Tue 09 Nov 2004 12:22
Location: Porto Alegre-Rio Grande do Sul - Brazil

Re: TOraSession Ping method

Post by jjeffman » Wed 21 Nov 2012 12:19

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

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Re: TOraSession Ping method

Post by AlexP » Wed 21 Nov 2012 14:26

Hello,

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

Post Reply