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: shell scripting help

Re: shell scripting help

From: d cheng <dc4oracle_at_yahoo.com>
Date: Wed, 3 Aug 2005 15:10:05 -0700 (PDT)
Message-ID: <20050803221006.20968.qmail@web34006.mail.mud.yahoo.com>


Thank you all for responding with your suggestions. The WAIT command worked!  

I split my original single sql script into three sql scripts to parallelize my workload.

stephen booth <stephenbooth.uk_at_gmail.com> wrote: On 03/08/05, d cheng wrote:
> << shell script snippet >>
> ...
> sqlplus un/pw @script1.sql &
> sqlplus un/pw @script2.sql &
> sqlplus un/pw @script3.sql &
> ...
> sqlplus un/pw @final.sql
> ...
> exit
>

Is there any particular reason you want to be running the initial scripts in the background? If not then just lose the ampersands and it should execute them in order, one at a time. This avoids the problem of final.sql being run before the others have completed.

Alternatively at the start of each script (apart from final.sql) put in a command to create a lock file (e.g. !touch script2.lock) and at the end a command to delete those files. Then before the call to final.sql put in a while loop that checks if those files exist and if they do sleeps for a period before checking again. When none of those files are present the loop quits and final.sql will be run. Maybe, to reduce any load from the while loop, estimate how long you think it will take the scripts to run and put a sleep command for that time period before the loop.

Stephen

-- 
It's better to ask a silly question than to make a silly assumption.

		
---------------------------------
 Start your day with Yahoo! - make it your home page 
--
http://www.freelists.org/webpage/oracle-l
Received on Wed Aug 03 2005 - 17:12:07 CDT

Original text of this message

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