Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> Korn Shell & Sqlplus

Korn Shell & Sqlplus

From: Hand, Michael T <HANDM_at_polaroid.com>
Date: Mon, 20 May 2002 11:55:11 -0800
Message-ID: <F001.00465140.20020520115511@fatcity.com>


> Maybe one of you has some inspiration.
>

Environment: Compaq Tru64 5.1; Oracle 8.1.7.3

> The concept is for a parent Korn shell to spawn a sqlplus child in
> background (which will validate table structure via a PL/SQL Block) then
> wait for a fixed time period before stopping/killing the sqlplus child.
> After the sqlplus child is stopped some follow-up processing is needed to
> "bookmark" where the sqlplus processing has stopped.
>
> My quick test script so far look like:
> #!/bin/ksh
> echo "Starting val_asc, spawning at " $(date) >> val_asc.out
> sqlplus xxxxx/xxxx @val_asc3.pls >> val_asc3.log &
valpid=$!
> sleep 240
> kill -KILL %1
> echo "Leaving val_asc at " $(date) >> val_asc.out
> exit
>

When the sqlplus line runs it starts 2 processes:
> oragdv 169035 167185 0.0 10:00:20 pts/1 0:00.18 sqlplus
> oragdv 169652 169035 0.0 10:00:22 ?? 0:00.13 oracleGDV
> (DESCRIPTION=(LOCAL=YES). . .
>

The problem is when the kill command executes, only the first of these 2 processes is killed immediately. The 2nd (with the PPID at 1) continues processing until the PL/SQL Block completes (including database updates) before it terminates.

> Here's the question. Is there a straightforward way to terminate that 2nd
> process before starting post processing?
>
> Any suggestions would be appreciated as I have been bashing my head
> against the proverbial wall for several days now ;)
I have used the $! parameter to id the sqlplus PID and have been fiddling with ps & awk to try and obtain the 2nd process's PID but have yet to be successful

> Michael Hand

Polaroid Corp

-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: Hand, Michael T
  INET: HANDM_at_polaroid.com

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).
Received on Mon May 20 2002 - 14:55:11 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US