Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Running multiple queries in parallel within a single session

Re: Running multiple queries in parallel within a single session

From: Daniel Morgan <dmorgan_at_exesolutions.com>
Date: Mon, 28 Oct 2002 16:43:26 GMT
Message-ID: <3DBD692D.372B2B8E@exesolutions.com>


Paul wrote:

> Hi all,
>
> Does anyone know a way of running multiple sql statements in
> "parallel" from within a single session?
>
> I'll expand on what I'm trying to achieve ...
>
> I am writing an application that extracts data from an oracle database
> and writes the output to delimited text files on a unix file system.
>
> I have 10 sql statements that define the content of 10 separate text
> files.
>
> At the moment I am running each of the 10 queries "sequentially"
> within a PL/SQL block, using DBMS_SQL and UTL_FILE to allow the
> creation of the text files.
>
> I was wondering if there was any way of running the 10 queries in
> parallel within the same session so that the text files are created
> simultaneously (the queries are mostly independent from each other in
> terms of table access).
>
> The reason I need them to run them all in the same session is because
> I need read consistency across the 10 text files and therefore am
> using ...
>
> "alter session set isolation_level=serializable;"
>
> ... at the start of the session to ensure this.
>
> If I did not need read consistency, I could have split the queries up
> within a unix shell script and run them all in background as this is
> how I have achieved this in the past.
>
> Thanks for any help/comments/advice.
>
> P.

Put your code into a stored procedure or package and execute using 10 separate jobs in DBMS_JOB.

Daniel Morgan Received on Mon Oct 28 2002 - 10:43:26 CST

Original text of this message

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