Re: shell scripting help

  • From: Jared Still <jkstill@xxxxxxxxx>
  • To: rlsmith@xxxxxxx
  • Date: Thu, 4 Aug 2005 10:46:11 -0700

That sounds incorrect to me.

Give it a try:

--- s.sql
exec dbms_lock.sleep(5)

exit

-- s.sh

sqlplus scott/tiger @s.sql 2>&1 >/dev/null &
sqlplus scott/tiger @s.sql 2>&1 >/dev/null &
sqlplus scott/tiger @s.sql 2>&1 >/dev/null &

echo waiting on sqlplus jobs
ps -flaujkstill | grep [s]qlplus

wait

---

10:47-6 > ./s.sh
waiting on sqlplus jobs
000 S jkstill 10926 10889 0 69 0 - 3737 read_c 10:24 pts/0 00:00:00 
/u01/app/oracle/product/9.2.0/bin/sqlplus
000 S jkstill 11344 11343 0 73 0 - 3364 pipe_w 10:48 pts/6 00:00:00 sqlplus
000 R jkstill 11345 11343 0 74 0 - 3442 - 10:48 pts/6 00:00:00 sqlplus
000 S jkstill 11346 11343 0 73 0 - 3442 pipe_w 10:48 pts/6 00:00:00 sqlplu


On 8/4/05, Smith, Ron L. <rlsmith@xxxxxxx> wrote:
> 
> Don't run them in the background (&). The second and third statements 
> won't run until the previous SQL finishes.
>  Ron
> 
>  -----Original Message-----
> *From:* oracle-l-bounce@xxxxxxxxxxxxx [mailto:
> oracle-l-bounce@xxxxxxxxxxxxx] *On Behalf Of *d cheng
> *Sent:* Wednesday, August 03, 2005 4:49 PM
> *To:* Oracle-L@xxxxxxxxxxxxx
> *Subject:* shell scripting help
> 
> Hi Listers,
>  I have a korn shell script which needs to run 3 sqlplus scripts in 
> parallel then run the final sqlplus script. Is there a way to ensure that 
> sqlplus scripts 1 thru 3 completes before running the final sqlplus script? 
> I am a newbie in shell scripting.
>  
> -- 
Jared Still
Certifiable Oracle DBA and Part Time Perl Evangelist

Other related posts: