2010年3月4日 星期四

Oracle dbms_job vs. dbms_scheduler

Features Comparison between dbms_job and dbms_scheduler

Feature

dbms_job

dbms_scheduler

Provide full integration of job creation and modification in Oracle Enterprise Manager.

Yes

Yes

Provide privileges and roles specifically for the scheduler to increase control over the scheduling of jobs.

No

Yes

Table 1.1 - Features comparison between the dbms_job and dbms_scheduler package

-- Old using dbms_job scheduler.

VARIABLE l_job NUMBER;
BEGIN
DBMS_JOB.submit (
job => :l_job,
what => 'BEGIN NULL; /* Do Nothing */ END;',
next_date => SYSDATE,
interval => 'SYSDATE + 1 /* 1 Day */');

COMMIT;
END;
/
PRINT l_job

-- New with dbms_scheduler scheduler.

BEGIN
DBMS_SCHEDULER.create_job (
job_name => 'dummy_job',
job_type => 'PLSQL_BLOCK',
job_action => 'BEGIN NULL; /* Do Nothing */ END;',
start_date => SYSTIMESTAMP,
repeat_interval => 'SYSTIMESTAMP + 1 /* 1 Day */');
END;
/


The new 10g job scheduling views

select
job_name,
enabled
from
user_scheduler_jobs;
and this:
select
job_id,
freq_type,
freq_interval,
freq_subday_type,
freq_subday_interval,
freq_relative_interval,
freq_recurrence_factor,
active_start_date,
active_end_date,
active_start_time,
active_end_time,
schedule_id
from
dba_scheduler_jobs;



source:http://www.dba-oracle.com/t_dbms_job_scheduler.htm

沒有留言: