Chapter 25. DBMS_JOB Built-in Package

The DBMS_JOB package allows you to schedule PL/SQL routines, or jobs, to run periodically based on intervals you define. Each job has an associated job ID, a next execution date, an interval function that computes the next execution date, and a flag indicating whether the job is broken. This chapter tests your ability to use the DBMS_JOB package to submit new jobs to the job queue, change a job’s execution parameters (for instance, how often it runs), and remove a job from the queue.

Beginner

25-1.

Why do you need the DBMS_JOB built-in package?

25-2.

Which three INIT.ORA parameters do you (or your DBA) need to set before using the DBMS_JOB package?

25-3.

What happens when JOB_QUEUE_PROCESSES = 1, and you submit two long-running jobs that execute at the same time?

25-4.

Is it possible to execute two instance of the same job by two different SNP background processes in parallel mode?

25-5.

What are the two DBMS_JOB procedures that submit jobs? What are their parameters?

25-6.

What is the difference between the DBMS_JOB.SUBMIT and DBMS_JOB.ISUBMIT procedures?

25-7.

You submit this job, but it doesn’t execute immediately. Why?

SQL> EXEC (33, 'calc_totals;', SYSDATE, 'SYSDATE + 1'); DBMS_JOB.ISUBMIT
PL/SQL procedure successfully completed.

25-8.

Why does the following job never execute?

DBMS_JOB.ISUBMIT (
      job => 33,
      what => 'NULL;',
      next_date => NULL,
      interval => 'SYSDATE + 1'
   );

25-9.

What is wrong with this call to ISUBMIT?

DBMS_JOB.ISUBMIT ( job => 33, what => 'foo', ...

Get Oracle PL/SQL Programming: A Developer's Workbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.