Skip to Main Content
  • Questions
  • Scheduler does not run after cloning

Breadcrumb

Question and Answer

Chris Saxon

Thanks for the question, Ralf.

Asked: July 09, 2021 - 10:30 am UTC

Last updated: July 12, 2021 - 8:47 am UTC

Version: 19c

Viewed 1000+ times

You Asked

Hi Chris/Connor,

we have a strange effect on a freshly cloned database where my DBAs are struggling since three days trying to solve this - so I thought maybe I ask you ;-)
This is our setup:

After the upgrade (of our production database) to Oracle 19.11. we wanted to get a new test-DB - so we cloned our production database (the standby part of the cluster) over a database link to our testmachine. After some problems (we had to switch the standy database to "apply-off") this worked fine and I have a full copy of our production which I can use for tests.

But: there is a problem with the scheduler. None of the jobs is running. When I query sys.user_scheduler_jobs and sys.user_scheduler_job_run_details I see all jobs which are defined, but all entries have a timestamp from before the cloning.

Even if I create a new job it is not executed at the scheduled time. I tried a very easy PLSQL_BLOCK job which only does one entry into a table - but it does not execute. It works if I issue a DBMS_SCHEDULER.RUN_JOB - but only if I set the use_current_session option to TRUE ... :-(

I have the impression that there is a real simple, obvious cause of all this ... but we seem all to be blind ;-)

Have you an idea what we are missing or some hints what we could check??
We also checked the DB parameter „job_queue_processes", it is set to 160 - and all jobs belong to the DEFAULT_JOB_CLASS.
One more hint: if I start one of the jobs from SQLDeveloper I get an immediate 'successful' response - but nothing is executed.

Many thanks for you support
Ralf

PS:
Here is the job I created (PA_TRACE is a package that writes log messages to a table)

begin
DBMS_SCHEDULER.CREATE_JOB(
       job_name          => 'TESTRK'
      ,job_type          => 'PLSQL_BLOCK'
      ,job_action        => 'begin schedule.pa_trace.trace(''Test by rkoellin'');end;'
      ,start_date        => sysdate
      ,repeat_interval   => 'FREQ = MINUTELY; INTERVAL = 5' -- run every 5 Minutes
      ,enabled           => TRUE
      ,auto_drop         => FALSE
      ,comments          => 'Test created by RKOELLIN' );
end;
/

and Chris said...

MOS note 2631878.1 runs through a whole bunch of things to check if scheduler jobs aren't running.

Many of these things you've probably already checked (job_queue_processes, overall database sessions, etc.).

There is an undocumented scheduler attribute though you're probably unaware of - SCHEDULER_DISABLED

select value 
from   dba_scheduler_global_attribute 
where  attribute_name='SCHEDULER_DISABLED';

VALUE   
true     


If this is true, it disables the scheduler. Set it to false to re-enable them:

exec dbms_scheduler.set_scheduler_attribute('scheduler_disabled','false');


If this still isn't the issue, review the MOS note and contact support if you're still stuck.

Is this answer out of date? If it is, please let us know via a Comment

More to Explore

Administration

Need more information on Administration? Check out the Administrators guide for the Oracle Database