grant execute on ELOAN.QLSJ_TRANSCONCURCONTROL to eloan;  --存储过程单独授权

 --创建JOB

 BEGIN
 sys.dbms_scheduler.create_job(
 job_name => ' ELOAN . QLSJ_TRANSCONCURCONTROL_1 ',
 job_type => 'STORED_PROCEDURE',
 job_action => 'QLSJ_TRANSCONCURCONTROL',                 --存储过程
 repeat_interval => 'FREQ=MINUTELY;INTERVAL=10',         --10分钟执行一次
 start_date => systimestamp at time zone '+8:00',
 job_class => ' DEFAULT_JOB_CLASS ',
 auto_drop => FALSE,
 enabled => FALSE);
 sys.dbms_scheduler.set_attribute( name => ' ELOAN . QLSJ_TRANSCONCURCONTROL_1 ', attribute => 'logging_level', value => DBMS_SCHEDULER.LOGGING_OFF);
 sys.dbms_scheduler.enable( ' ELOAN . QLSJ_TRANSCONCURCONTROL_1 ' );
 end;

  select from dba_scheduler_jobs a where  a.JOB_NAME='QLSJ_TRANSCONCURCONTROL_1';      --查看job策略
  select
from dba_scheduler_job_run_details a where a.JOB_NAME='QLSJ_TRANSCONCURCONTROL_1';    --查看job执行记录      

Related Posts