in reply to Re: SQLPLUS connect database
in thread SQLPLUS connect database

Hi Dave, yes. I added '/' to escape @ as it was considering @ as global symbol. I tried to use capture with the connected db, stdout output is "SQL*Plus: Release 12.1.0.2.0 Production" stder output is blank and exit output is 0. the output is the same with the down db. My intention is to verify database connection, so it is not a solution for me. And I cannot use DBI module.

Replies are listed 'Best First'.
Re^3: SQLPLUS connect database
by holli (Abbot) on Jul 24, 2019 at 15:25 UTC
    The TNSPING utility can be used to test an Oracle Service Name. To use it:

    1.Open a Command Prompt (click Start, click Run, type cmd, and then click OK).

    2.Type tnsping <service name> (for Oracle 7.3 or Oracle 8i and later) or tnsping80 <service name> (for Oracle 8.0), and then press enter.

    The TNS Ping Utility will result in an "OK" or a "Connect failed" message. [...]
    This was basically the first result searching for "oracle test connection command line" btw. Sauce


    holli

    You can lead your users to water, but alas, you cannot drown them.
      I tried tnsping, it only shows me whatever I configured in tnsnames.ora
        Maybe it does that wenn you run it without arguments. Did you pass the <service name> in as it says in the docs?


        holli

        You can lead your users to water, but alas, you cannot drown them.