Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

How to execute multiple scripts simultaneously.

LostInPermuationsDec 2 2015 — edited Dec 3 2015

I'm trying to execute a large data set.  The DBA team is throwing a fit because it's taking hours to execute.  But I'm currently running them sequencially.

My question is:  What is the best way to execute multiple sql scripts that contain DML statements at the same time.

I'm going to take the big scripts (combination of inserts, updates, deletes) and break them up into multiple smaller scripts.

I'm looking to figure out how to fire off each script, but not wait for it to finish.  It just immediately returns to the prompt...or in this case, would fire off the next script.

For example:

@sql_script_1a.sql

@sql_script_1b.sql

@sql_script_1c.sql

I thought I could do:

BEGIN execute immediate

'@./sql_script_1a.sql';

'@./sql_script_1b.sql';

'@./sql_script_1c.sql';

END;

/

But this does not work.  It keeps telling me invalid sql statement.

But the key question here is to make it "fire and forget" each script so that they are running at the same time.

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 31 2015
Added on Dec 2 2015
6 comments
1,663 views