Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

How do I jobstream using DBMS_SUBMIT or something else?

Posted on 2003-03-24
3
Medium Priority
?
964 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
2 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

How to Create User-Defined Aggregates in Oracle Before we begin creating these things, what are user-defined aggregates?  They are a feature introduced in Oracle 9i that allows a developer to create his or her own functions like "SUM", "AVG", and…
From implementing a password expiration date, to datatype conversions and file export options, these are some useful settings I've found in Jasper Server.
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function
This video shows how to copy an entire tablespace from one database to another database using Transportable Tablespace functionality.
Suggested Courses
Course of the Month10 days, 10 hours left to enroll

572 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