Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: running a PL/SQL program in the background
A copy of this was sent to Gerhard.Moeller_at_OFFIS.Uni-Oldenburg.de (Gerhard
Moeller)
(if that email address didn't require changing)
On Thu, 16 Apr 1998 09:15:24 GMT, you wrote:
>Hi,
>
>at the moment I program an admin tool for my project including context
>usable from webbrowsers. As some of the operations (e.g. optimize
>indexes) are rather lengthy in execution, I would like to start PL/SQL
>procedures in the background to give control instantely back to the
>user. (in other words: those functions should be not executed modal)
>
>The only idea I have at the moment is to create PL/SQL procedures on
>the fly (with dbms_sql.parse) ans submit them as a job, executed
>instantely.
>
>The problem with this sulution is that I have to get rid of the jobs
>and the procedures after execution. (There are just to many different
Why do you have to get rid of them? If you submit a job in this fashion:
declare
l_job number;
begin
dbms_job.submit( l_job, 'some_procedure_to_run_once;' );
commit;
end;
That will submit a job that runs once and will remove itself from the queue after it successfully completes (since NEXT_DATE wasn't set). That sounds like it is exactly what you want.
>procedures to let them exist all the time.) Of course, this could be
>done with some job that is executed regulary and checking what jobs
>are done and can be safely destroyed. But this is rather a bad hack
>than a clean solution.
>
>So... ...is there any other way to let PL/SQL procedures be executed
>in the background?
>
> Thanks for any hint, Gerhard.
Thomas Kyte
tkyte_at_us.oracle.com
Oracle Government
Herndon VA
http://govt.us.oracle.com/ -- downloadable utilities
Anti-Anti Spam Msg: if you want an answer emailed to you, you have to make it easy to get email to you. Any bounced email will be treated the same way i treat SPAM-- I delete it. Received on Thu Apr 16 1998 - 08:25:09 CDT