Find the answer to your Linux question:
Results 1 to 3 of 3
Hi, I'm using simple sqlplus to test DB availability. When DB is going down, sqlplus command is hang for a few minutes I want to implement the following: 1. execute ...
  1. #1
    Just Joined!
    Join Date
    Aug 2009
    Posts
    5

    control timeout of sqlplus process

    Hi,

    I'm using simple sqlplus to test DB availability.

    When DB is going down, sqlplus command is hang for a few minutes

    I want to implement the following:

    1. execute sqlplus
    2. if after 20 sec I dont get a response, kill the process and exit with error.
    3. if I get immediate response (DB is up), go on without waiting 20 sec.

    Thanks

  2. #2
    drl
    drl is offline
    Linux Engineer drl's Avatar
    Join Date
    Apr 2006
    Location
    Saint Paul, MN, USA / CentOS, Debian, Solaris, SuSE
    Posts
    1,117
    Hi.

    There is a shell script and an expect script to run commands with a maximum time in the thread at comp.unix.shell | Google Groups

    I have not tried either one, but they look straight-forward.

    Good luck ... cheers, drl
    Welcome - get the most out of the forum by reading forum basics and guidelines: click here.
    90% of questions can be answered by using man pages, Quick Search, Advanced Search, Google search, Wikipedia.
    We look forward to helping you with the challenge of the other 10%.
    ( Mn, 2.6.n, AMD-64 3000+, ASUS A8V Deluxe, 1 GB, SATA + IDE, Matrox G400 AGP )

  3. #3
    Just Joined!
    Join Date
    Jul 2009
    Posts
    58
    You're better off running a small c or perl program to check the status of a db than trying to do a sqlplus call. There are too many messages that you can't "expect" or will give you a positive when in fact it isn't working.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...