Our Oracle Scheduler isn't working in several of our environments but does work in some. In the environments where it is working, the following query returns 1 row
select program from v$session where osuser = 'oracle' and program like '%(CJQ0)%';
[email protected] (CJQ0)
In the environments where it is not working, no rows are returned.
This is the test that I performed to see if the Scheduler was running. It should instantly fire off the job.
CREATE TABLE MySchema.TEMP_DBMS_JOB (
A NUMBER(*, 0))
DECLARE
l_jobid int;
BEGIN
dbms_job.submit(job => l_jobid, what => 'begin insert into MySchema.temp_dbms_job (a) values (13); commit; end;');
dbms_output.put_line(l_jobid);
COMMIT;
END;
What can the DBA do to get the Scheduler running? Does the "CJQ0" session query help you identify what might be the underlying source of the problem? The DBA sees no issues with the configuration of the scheduler.
We also tried DBMS_SCHEDULER.create_job to submit the jobs instead of the deprecated dbms_job.submit and had the exact same outcome in the same environments.
job_queue_processes
with # of jobs running in the system (dba_scheduler_running_jobs
) per instance. If it's maxed, you can't run a job until other jobs complete. Sometimes however Oracle gets them into a funky status and thinks they are unavailable when that's not true. In this case, in some versions we've had success setting job_queue_processes to 0 and then back to what it was originally. If that doesn't work, try raising job_queue_processes a bit over its current value.