create user test2 identified by test2;
grant create session to test2;
conn test2/test2@pdb1
declare
l_job pls_integer;
begin
dbms_job.submit (
job => l_job,
what => 'begin null; end;',
next_date => trunc(sysdate)+1,
interval => 'trunc(sysdate)+1'
);
end;
/
Error report -
ORA-27486: insufficient privileges
ORA-06512: at "SYS.DBMS_ISCHED", line 9387
ORA-06512: at "SYS.DBMS_ISCHED", line 9376
ORA-06512: at "SYS.DBMS_ISCHED", line 175
ORA-06512: at "SYS.DBMS_ISCHED", line 9302
ORA-06512: at "SYS.DBMS_IJOB", line 196
ORA-06512: at "SYS.DBMS_JOB", line 168
ORA-06512: at line 4
27486. 00000 - "insufficient privileges"
*Cause: An attempt was made to perform a scheduler operation without the
required privileges.
*Action: Ask a sufficiently privileged user to perform the requested
operation, or grant the required privileges to the proper user(s).
SQL>
begin
dbms_refresh.make(
name => 'MINUTE_REFRESH',
list => '',
next_date => sysdate,
interval => '/*1:mins*/ sysdate + 1/(60*24)',
implicit_destroy => false,
lax => false,
job => 0,
rollback_seg => null,
push_deferred_rpc => true,
refresh_after_errors => true,
purge_option => null,
parallelism => null,
heap_size => null);
end;
/
select job_name, job_action from user_scheduler_jobs;
JOB_NAME JOB_ACTION
------------------------------ ------------------------------
MV_RF$J_0_S_242 dbms_refresh.refresh('"TEST2".
"MINUTE_REFRESH"');
1 row selected.
SQL>
begin
dbms_scheduler.set_attribute (
name => 'MV_RF$J_0_S_242',
attribute => 'job_action',
value => 'begin null; end;'
);
end;
/
SELECT job_name, job_action FROM user_scheduler_jobs;
JOB_NAME JOB_ACTION
------------------------------ ------------------------------
MV_RF$J_0_S_242 begin null; end;
1 row selected.
SQL>