1. Get rid of all advertisements and get unlimited access to documents by upgrading to Premium Membership. Upgrade to Premium Now and also get a Premium Badge!

Question on dbms scheduler

Discussion in 'SQL PL/SQL' started by Shanmugapriya, Aug 1, 2016.

  1. Shanmugapriya

    Shanmugapriya Active Member

    Messages:
    32
    Likes Received:
    0
    Trophy Points:
    80
    Location:
    Bangalore
    Hi,
    I have a Scheduler by name says 'ABC'.
    I need to stop the job for some time and then restart the job.

    After I stop the job, how do I restart the job.
     
  2. Siddhartha

    Siddhartha Active Member

    Messages:
    16
    Likes Received:
    2
    Trophy Points:
    90
    Location:
    Bangalore
    BEGIN

    DBMS_SCHEDULER.DISABLE('ABC');

    END;

    /


    BEGIN

    DBMS_SCHEDULER.ENABLE('ABC');

    END;

    /
     
  3. Shanmugapriya

    Shanmugapriya Active Member

    Messages:
    32
    Likes Received:
    0
    Trophy Points:
    80
    Location:
    Bangalore
    Hi Siddhartha,
    I did try this, but it does not allow to disable before stopping. You need to stop and then disable or drop.
    So, Is there any way to stop and re-start.
     
  4. Siddhartha

    Siddhartha Active Member

    Messages:
    16
    Likes Received:
    2
    Trophy Points:
    90
    Location:
    Bangalore
    What kind of scheduler is it ,dbms_scheduler,dbms_jobs?
     
  5. Shanmugapriya

    Shanmugapriya Active Member

    Messages:
    32
    Likes Received:
    0
    Trophy Points:
    80
    Location:
    Bangalore
    It is dbms_scheduler as mentioned above.
     
  6. Vicky

    Vicky Forum Advisor

    Messages:
    261
    Likes Received:
    11
    Trophy Points:
    260
    Location:
    Chennai
    Jobs are normally run asynchronously under the control of the job coordinator, but they can be controlled manually using the RUN_JOB and STOP_JOB procedures.

    BEGIN
    -- Run job synchronously.
    DBMS_SCHEDULER.run_job (job_name => 'test_full_job_definition',
    use_current_session => TRUE);

    -- Stop jobs.
    DBMS_SCHEDULER.stop_job (job_name => 'test_full_job_definition, test_prog_sched_job_definition');
    END;
    /
     
    Sadik likes this.