2

Is there someone who can strictly give me what is the job (DBMS_JOB) and the scheduler (DBMS_SCHEDULER) in oracle? and what's its roles ?

Regards.

oluies
  • 17,694
  • 14
  • 74
  • 117
kaissun
  • 3,044
  • 4
  • 20
  • 35
  • 2
    Duplicate of http://stackoverflow.com/questions/4152111/dbms-job-vs-dbms-scheduler – Gaius Dec 14 '11 at 14:54
  • 1
    oh yeah sorry but before asking my question, I search about job and scheduler in oracle 10g not with DBMS.. thank you anyway – kaissun Dec 14 '11 at 14:57

2 Answers2

13

At first glance it looks like only other names with more human readable schedules for dbms_scheduler, compared to dbms_job. When looking slightly better, there are loads of differences, even in Oracle 10gR1. Currently we are in 11gR2. Every release dbms_scheduler gets more enhancements, where dbms_job has been static for many years.

Differences

  • dbms_scheduler has logging
  • dbms_scheduler has external jobs
  • dbms_scheduler has job chains
  • dbms_scheduler has job event handling (can raise and react upon events)
  • dbms_scheduler has resource manager integration
  • dbms_scheduler has human readable calendar syntax
  • dbms_scheduler can combine different calendars in a new one

In 11g extra

  • dbms_scheduler has remote external jobs
  • dbms_scheduler has light weight jobs - generate many low overhead jobs in one tx
  • dbms_scheduler can send mail on job completion
  • dbms_scheduler jobs can have multiple targets

dbms_job can only run pl/sql type of jobs in the current database.

I hope this (in complete list) helps

5

Both allow you to schedule jobs to be executed at a given time. The main difference is how you specify them, apart from that there is no noticeable difference in practice.

DBMS_SCHEDULER also allows you to set your custome schedule intervals, which DBMS_JOB doesn't. In fact,the most important difference is that DBMS_JOB is deprecated and will therefore be desupported before DBMS_SCHEDULER is.

fge
  • 119,121
  • 33
  • 254
  • 329
  • 2
    Ahem, there are loads of differences in practice. Big ones are dependencies between jobs, integration with resource manager, and much easier to describe complicated scheduling (rather than just start date and time interval). – Gaius Dec 14 '11 at 14:57
  • 2
    Also, one is transactional and one is not. In other words, a call to one fallowed by a rollback will not have added anything to the schedule, while the other uses an anonymous transaction and will go forward whether the calling transaction commits or rollsback. I don't remember which is which, but I'm sure the docs do: http://docs.oracle.com/cd/E11882_01/appdev.112/e25788/toc.htm – Shannon Severance Dec 14 '11 at 15:46
  • 1
    @Shannon: `DBMS_JOB` is controlled by transaction, `DBMS_SCHEDULER` issues a commit when creating jobs. However, in most circumstances, you shouldn't use `DBMS_SCHEDULER` to create jobs on an ad hoc basis. You should create the job once, parameterized if necessary, then schedule the named job dynamically. It's really one of the core differences: `DBMS_SCHEDULER` jobs act more like other database objects than `DBMS_JOB` jobs. – Allan Dec 14 '11 at 19:46