sql - Using DBMS_SCHEDULER.CREATE_JOB within a procedure -
i trying create procedure perform updates on couple tables , schedule procedure run later revert them back. i'm running problem in using dbms_scheduler.create_job. code looks this:
create or replace procedure my_procedure(p_duns in varchar2, p_plus_four in varchar2) *some variables* begin *do stuff* p_job_action := 'begin run_other_procedure(' || p_vendor_id || ', ' || p_ccrid || ', ' || nvl(to_char(p_inactive_date),'null') || ',' || nvl(to_char(p_end_date),'null') || '); end;'; dbms_scheduler.create_job(job_name => 'deactive_vendor_'||to_char(p_ccrid), job_type => 'plsql_block', job_action => p_job_action, start_date => sysdate+1, enabled => true, comments => 'calls plsql once'); end;
i have verified beginning portion of procedure, when add in create_job i'm getting below error:
error starting @ line : 1 in command - execute my_procedure('140986105', null) error report - ora-27486: insufficient privileges ora-06512: @ "sys.dbms_isched", line 124 ora-06512: @ "sys.dbms_scheduler", line 271 ora-06512: @ "cgext.my_procedure", line 63 ora-06512: @ line 1 27486. 00000 - "insufficient privileges" *cause: attempt made perform scheduler operation without required privileges. *action: ask sufficiently privileged user perform requested operation, or grant required privileges proper user(s).
when pull out create_job , run have no problems.
any thoughts on this?