RE: Unix Question

  • From: "Powell, Mark D" <mark.powell@xxxxxxx>
  • To: "'oracle-l@xxxxxxxxxxxxx'" <oracle-l@xxxxxxxxxxxxx>
  • Date: Wed, 26 May 2004 09:31:54 -0400

Here is an idea.  Add a write to a dbms_pipe to each script that sends the
task return code to the pipe reader.  Now add one more script that opens the
pipe for read and goes into a loop: read, sleep until all tasks have
registered.  When all tasks have registered thier ending status then this
monitoring task exists success otherwise it fires off an error message and
exists failure.

Also shouldn't you be appending the log messages (>>) rather than creating
the log file,(>).

HTH -- Mark D Powell --


-----Original Message-----
From: oracle-l-bounce@xxxxxxxxxxxxx
[mailto:oracle-l-bounce@xxxxxxxxxxxxx]On Behalf Of Ryan
Sent: Tuesday, May 25, 2004 10:35 PM
To: oracle-l@xxxxxxxxxxxxx
Subject: OT: Unix Question


Its related to Oracle. I need to parallelize some SQL. I need to use korn
shell to do it. My problem, is how do I run multiple processes in the
background and return the exit status from each one? So I can know when to
check for errors.
One way is to write the exit statuses to a file. I would prefer not to do
that. This is what I have right here. 

nohup run_sql $ERROR_MSG_OPTION -u $LOGIN_FILE_NAME $SQL_SCRIPT1 2>&1 >
sql_script1.log; message "$? $SQL_SCRIPT1" $STATUS_FILE &
nohup run_sql $ERROR_MSG_OPTION -u $LOGIN_FILE_NAME $SQL_SCRIPT2 2>&1 >
sql_script1.log;
message "$? SQL_SCRIPT2" $STATUS_FILE &
wait

----------------------------------------------------------------
Please see the official ORACLE-L FAQ: http://www.orafaq.com
----------------------------------------------------------------
To unsubscribe send email to:  oracle-l-request@xxxxxxxxxxxxx
put 'unsubscribe' in the subject line.
--
Archives are at //www.freelists.org/archives/oracle-l/
FAQ is at //www.freelists.org/help/fom-serve/cache/1.html
-----------------------------------------------------------------
----------------------------------------------------------------
Please see the official ORACLE-L FAQ: http://www.orafaq.com
----------------------------------------------------------------
To unsubscribe send email to:  oracle-l-request@xxxxxxxxxxxxx
put 'unsubscribe' in the subject line.
--
Archives are at //www.freelists.org/archives/oracle-l/
FAQ is at //www.freelists.org/help/fom-serve/cache/1.html
-----------------------------------------------------------------

Other related posts: