December 2010
Intermediate to advanced
451 pages
11h 16m
English
You want to schedule a PL/SQL procedure to run at a fixed time or at fixed intervals.
Use the EXEC DBMS_SCHEDULER.CREATE_JOB procedure to create and schedule one-time jobs and jobs that run on a recurring schedule. Suppose, for example, that you need to run a stored procedure named calc_commissions every night at 2:30 a.m. to calculate commissions based on the employees' salaries. Normally, commissions would be based on sales, but the default HR schema doesn't provide that table, so we'll use an alternate calculation for demonstration purposes:
EXEC DBMS_SCHEDULER.CREATE_JOB ( -
JOB_NAME=>'nighly_commissions', -
JOB_TYPE=>'STORED_PROCEDURE', - JOB_ACTION=>'calc_commisions', - ...Read now
Unlock full access