| Oracle Community
All Places > Databas e > Oracle Databas e + Options > Scheduler > Dis cus s ions
https://community.oracle.com/thread/648581 1/10
3/4/2015 Answers to "Why are my jobs not running?&q... | Oracle Community
If this is the problem you can increase the number or just NULL it out using
SQL> exec dbms_scheduler.set_scheduler_attribute('max_job_slave_processes',null)
If the numbers are too close you can increase the maximum using
SQL> alter system set job_queue_processes=200;
4) Have you recently applied a timezone update patch or upgraded the database
to a version with newer timezone information ? If you skipped any steps when
updating the timezone information, jobs may not run. To check whether this
is the case try doing
SQL> select * from sys.scheduler$_job;
and
SQL> select * from sys.scheduler$_window;
and make sure they finish without errors.
https://community.oracle.com/thread/648581 2/10
3/4/2015 Answers to "Why are my jobs not running?&q... | Oracle Community
If the database is running in restricted mode then no jobs will run (unless
you are using 11g and use the ALLOW_RUNS_IN_RESTRICTED_MODE attribute).
To check this use
SQL> select logins from v$instance ;
You can check this by seeing whether instance_id is set for the job (check the dba_scheduler_jobs view), and if so you should check whether that
instance is up.
7) Is the job scheduled to run on a service which has not been started on any instances ?
You can check this by checking what job_class a job points to and then checking whether that class points to a service. If it does, make sure the
service has been started on at least one running instance. You can start a service on an instance using dbms_service.start_service.
If a restrictive resource plan is in effect, scheduler jobs may not have sufficient resources allocated so they may not run. You can check what
resource plan is in effect by doing
If no plan is in effect or the plan in effect is INTERNAL_PLAN then the resource manager is not in effect. If the resource manager is in effect you
can disable it by doing
If this query returns TRUE then you can fix this using
SQL> exec dbms_scheduler.set_scheduler_attribute('scheduler_disabled','false');
https://community.oracle.com/thread/648581 3/10
3/4/2015 Answers to "Why are my jobs not running?&q... | Oracle Community
1) The first thing to check is the timezone that the job is scheduled with
SQL> select owner, job_name, next_run_date from dba_scheduler_jobs ;
If the jobs are in the wrong timezone they may not run at the expected
time. If the next_run_date is using an absolute timezone offset (like
+08:00) instead of a named timezone (like US/PACIFIC) then the jobs may not
run as expected if daylight savings is in effect - they may run an hour
early or late.
2) It may be that at the time the job was scheduled to run, one of the several
limits above may have been temporarily reached causing the job to be delayed.
Check if the limits above are high enough and if possible check them during
the time that the job is being delayed.
3) One possible reason that one of the above limits may be hit is that a
maintenance window may have come into effect. Maintenance windows are Oracle
Scheduler windows that belong to the window group named
MAINTENANCE_WINDOW_GROUP. During a scheduled maintenance window, several
maintenance tasks are run using jobs. This may cause one of the limits listed
above to be hit and user jobs to be delayed. See the admin guide for more info
about this (chapter 24).
To fix this you can either increase the limits or reschedule the maintenance
windows to run at more convenient times.
If none of this works, here are some further steps you can take to try to
figure out what is going on.
https://community.oracle.com/thread/648581 4/10
3/4/2015 Answers to "Why are my jobs not running?&q... | Oracle Community
1) Check whether there are any errors in the alert log. If the database is
having trouble allocating memory or has run out of disk space or any other
catastrophic errors have occurred, you should resolve those first. You can
find the location of the alert log by using
SQL> select value from v$parameter where name = 'background_dump_dest';
The alert log will be in this directory with a name starting with "alert".
3) If either of the above indicates that the SYSAUX tablespace (where the scheduler stores its logging tables) is full, you can use the
dbms_scheduler.purge_log procedure to clear out old log entries.
4) See if there is a window currently open. If there is, you can try closing it to see if that helps .
SQL> select * from DBA_SCHEDULER_GLOBAL_ATTRIBUTE where
attribute_name='CURRENT_OPEN_WINDOW';
SQL> exec DBMS_SCHEDULER.close_window ('WEEKNIGHT_WINDOW');
6) If a simple run-once job doesn't run, you can try restarting the scheduler as follows.
https://community.oracle.com/thread/648581 5/10
3/4/2015 Answers to "Why are my jobs not running?&q... | Oracle Community
SQL>
SQL> alter system flush shared_pool;
SQL> alter system flush shared_pool;
SQL>
SQL> exec dbms_ijob.set_enabled(TRUE);
SQL> alter system set job_queue_processes=99;
SQL> exec dbms_scheduler.set_scheduler_attribute('SCHEDULER_DISABLED', 'FALSE');
(0 ratings )
Very good info. Thanks. One more thing, though. How about jobs that hang in the "running" state? We have a job that does an export of a user's
partitioned tables by invoking a shell script on the local file system. When we run the script from the OS command line, it completes fine. When we run
the exact same script from the scheduler, it hangs. I'd love to see any troubleshooting pointers for jobs that don't complete you may have put together.
It's almost like it times out...
Thanks
https://community.oracle.com/thread/648581 6/10
3/4/2015 Answers to "Why are my jobs not running?&q... | Oracle Community
Hi,
Hanging PL/SQL jobs and hanging external jobs need to be treated differently.
- hanging pl/sql jobs are typically associated with a real background session which is hanging and issues can be tracked down using normal
tools/methods to track down oracle hangs (see what sql statement is being run, see what locks are being held/waited on etc).
- hanging external jobs may be the result of a hanging script or may be hanging because the external job never returned results. Both of these issues
are covered in the post on running external jobs here
Guide to External Jobs on 10g with dbms_scheduler e.g. scripts,batch files
First check whether the script is running (look through the process list for the name of the script or the commands that the script runs).
If it is, then you need to debug the script itself or you may be running into the bug where the scheduler hangs on large amounts of stderr (fixed in version
10.2.0.2) in which case you should redirect stderr to a file.
If nothing is running then you should check your permissions, in particular, the user that the job runs as must have execute access on
$ORACLE_HOME/bin and all parent directories. So for e.g. if your $ORACLE_HOME is /opt/oracle/db then you would have to make sure that
You nailed it, Ravi. The script was calling the exp command. The command had "> /dev/null" appended to it. Once I changed it to ">& /dev/null", it all
worked fine.
https://community.oracle.com/thread/648581 7/10
3/4/2015 Answers to "Why are my jobs not running?&q... | Oracle Community
Thanks a lot
A job that has auto_drop = false and end_time < sysdate also won't run. From what I see, resetting the end_date to null makes the job look like able to
run but the job log keeps showing 'end time reached'.
Ronald.
http://ronr.nl/unix-dba
Hi Ronald,
As you probably know. Jobs should not be running if end_date < sysdate since this is the purpose of the end_date attribute as documented.
However, it looks like you have run into a bug in that resetting the end_date and then reenabling the job still doesn't force the job to start running again.
This is the first time that this bug has been reported.
I will need some info from you to be able to better track this as a bug and get it fixed in the next release (and possibly backported). I will try to contact
you directly.
Thanks,
Ravi.
https://community.oracle.com/thread/648581 8/10
3/4/2015 Answers to "Why are my jobs not running?&q... | Oracle Community
Hi,
The bug Ronald found (resetting end_date for a completed job does not work) has been filed internally as bug #7607696 and is being investigated.
-Ravi
Hi Ravi,
an other reason for a job not to run is that the database is 10.2.0.4, has plenty resources available and is using resource manager. I see this happen on
systems that have lots of cpu idle, a resource manager plan that has no limits on cpu. What I see is that the job just keeps status scheduled. In the
resource manager monitors there is nothing to see what is waiting for resources. It all starts running as soon as we switch to the INTERNAL_PLAN,
effectively switching off resource manager.
Strange is there are no waiters for resources ...
regards,
Ronald.
https://community.oracle.com/thread/648581 9/10
3/4/2015 Answers to "Why are my jobs not running?&q... | Oracle Community
Hi,
Just want to add that if you are using dbms_job to submit your job, your job will be running in accordance of how your database timezone is set.
For example,
My dbtimezone is set to a time which is 2 hours behind than my local server date.
Hence, if i will submit a job via dbms_job procedure to run now, the job will actually run 2 hours later.
Thanks.
Powered by
Oracle Technology Network
Oracle Com m unities Directory FAQ
About Oracle Oracle and Sun RSS Feeds Subscribe Careers Contact Us Site Maps Legal Notices Term s of Use Your Privacy Rights Cookie Preferences
https://community.oracle.com/thread/648581 10/10