?
Solved

How do I jobstream using DBMS_SUBMIT or something else?

Posted on 2003-03-24
3
Medium Priority
?
960 Views
Last Modified: 2013-12-11
I have a stored procedure that's executed immediately (dbms_submit and _run) from sqlplus.  After the job finishes (which could be an hour or more), I would like additional jobs to be run.  Is there anyway to jobstream from sqlplus based on job dependency, not date/time?
0
Comment
Question by:pawacht
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 1

Accepted Solution

by:
mona1974 earned 100 total points
ID: 8196441
For the first job use DBMS_JOB.isubmit (v_job_id, v_sql, SYSDATE);

Create and run a procedure which will monitor if the job is running or not.

declare
x integer;
begin
        x := 0;
         WHILE x = 0
         LOOP
            BEGIN
               SELECT job
                 INTO v$job
                 FROM DBA_JOBS_RUNNING /* or DBA_JOBS */
                WHERE job = v_job_id;
            EXCEPTION
               WHEN NO_DATA_FOUND
               THEN
                  x := 1;
            END;
         END LOOP;
-- second job
DBMS_JOB.submit (v_job_id, v_sql, SYSDATE);
end;
0
 
LVL 22

Expert Comment

by:Helena Marková
ID: 10216404
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

Accept mona1974's comment as answer.

Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

Henka
EE Cleanup Volunteer
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever had to make fundamental changes to a table in Oracle, but haven't been able to get any downtime?  I'm talking things like: * Dropping columns * Shrinking allocated space * Removing chained blocks and restoring the PCTFREE * Re-or…
Cursors in Oracle: A cursor is used to process individual rows returned by database system for a query. In oracle every SQL statement executed by the oracle server has a private area. This area contains information about the SQL statement and the…
This video explains at a high level with the mandatory Oracle Memory processes are as well as touching on some of the more common optional ones.
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
Suggested Courses

801 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question