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

Home -> Community -> Mailing Lists -> Oracle-L -> RE: wait/notify syntax for unix help please

RE: wait/notify syntax for unix help please

From: <Stephen.Lee_at_DTAG.Com>
Date: Mon, 27 Oct 2003 09:14:26 -0800
Message-ID: <F001.005D4B1C.20031027091426@fatcity.com>

Here's another idea. Expand on it and modify as needed.

   COUNT=1
   while [ $COUNT -le 8 ]; do

      ## The first jobs command is to clear out any "jobs completed" messages.

      jobs > /dev/null
      if [ -z "`jobs`" ]; then break; fi
      sleep 30
      COUNT=$(( $COUNT + 1 ))

   done
   jobs > /dev/null
   echo "SLEPT $COUNT times" >> "$LOG_FILE"

   ## Kill any remaining jobs.
   for JOB_NUMBER in `jobs | sed 's/\([^0-9]*\)\([1-9][0-9]*\)\(.*\)/\2/'`; do

      kill %${JOB_NUMBER}
      echo "killed job number $JOB_NUMBER" >> "$LOG_FILE"
   done

>
> I need to parallelize some sql operations and Im running them
> from unix
> scripts.
>
> I want to spawn off a few in the background from a master
> script, then have
> the master script 'wait' for them to finish. Ive done this in
> Java and with
> dbms_alert, but I cant dig up the syntax to do this with korn shell on
> solaris.
>
> Also, if I want to wait for a specific PID, how do I get the
> PID of the
> thread I want to wait for?
>
> so I have
>
> nohup run_sql &
>
> wait(on previous nohup)
>
> then to use notify, I just use 'notify()' inside the script right?
>

-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.net
-- 
Author: <Stephen.Lee_at_DTAG.Com
  INET: Stephen.Lee_at_DTAG.Com

Fat City Network Services    -- 858-538-5051 http://www.fatcity.com
San Diego, California        -- Mailing list and web hosting services
---------------------------------------------------------------------
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 Oct 27 2003 - 11:14:26 CST

Original text of this message

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