0
votes

I created a scheduler job in the following way:

BEGIN
DBMS_SCHEDULER.CREATE_JOB (
job_name           =>  'update_sales_1',
job_type           =>  'STORED_PROCEDURE',
job_action         =>  'test_job',
start_date         =>  systimestamp,
repeat_interval  =>  'FREQ=SECONDLY;INTERVAL=10',
end_date           =>  '20-NOV-2021 07.00.00 PM Australia/Sydney',
auto_drop          =>   FALSE,

comments           =>  'My new job');
END;
/

The stored procedure test_job inserts record into a table.
After creating the JOB, I enabled it and waited for 20 seconds and checked the table. I do not see the records inserted.

1
Does the procedure have a commit following the insert statement? - Boneist
Yes it has @Boneist - Prosenjit
What does USER_SCHEDULER_JOB_RUN_DETAILS show for your job? Also, what is the next_run_date in USER_SCHEDULER_JOBS for this job? - Boneist
select * from USER_SCHEDULER_JOB_RUN_DETAILS shows no rows selected and next_run_date is 13-JAN-20 06.01.03.000000000 AM -05:00 - Prosenjit
Assuming your job has been set up correctly, perhaps it's something else (such as parameters that are set too low for the job to be able to be run). Try working your way through the suggestions in this FAQ - Boneist

1 Answers

-1
votes

You should add a parameter enabled => TRUE, default is FALSE.

If you want to enable the job after creating it you can also use:
DBMS_SCHEDULER.ENABLE(name => 'update_sales_1');

If your job did run, and you don't see anything that has happened you might can look at the job run details if something went wrong:
SELECT * FROM dba_scheduler_job_run_details WHERE job_name = UPPER('update_sales_1') ORDER BY actual_start_date;