Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> RE: Unix Question
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_at_freelists.org
[mailto:oracle-l-bounce_at_freelists.org]On Behalf Of Ryan
Sent: Tuesday, May 25, 2004 10:35 PM
To: oracle-l_at_freelists.org
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
FAQ is at http://www.freelists.org/help/fom-serve/cache/1.htmlput 'unsubscribe' in the subject line.
-----------------------------------------------------------------
----------------------------------------------------------------
Please see the official ORACLE-L FAQ: http://www.orafaq.com
----------------------------------------------------------------
To unsubscribe send email to: oracle-l-request_at_freelists.org
![]() |
![]() |