Simultaneously execute two queries on a shell script
Posted
by
Alex
on Programmers
See other posts from Programmers
or by Alex
Published on 2012-06-06T15:19:13Z
Indexed on
2012/06/06
16:49 UTC
Read the original article
Hit count: 388
I have a shell script in which I have to execute two queries (on different databases), spool their results to text files and finally call a c++ program that processes the information on those text files. Something like this:
sqlplus user1/pw1@database1 @query1.sql
sqlplus user2/pw2@database2 @query2.sql
./process_db_output
Both queries take some time to execute. One of them can take up to 10 minutes, while the other one is usually faster. What I want to do is execute them simultaneously and when both are done, call the processing utility.
Any suggestion on how to do so?
© Programmers or respective owner