from :https://community.oracle.com/thread/648581

This is one of the most common Scheduler questions asked.

Here we list some of the common problems and their solutions.



1) job_queue_processes may be too low (this is the most common problem)

The value of job_queue_processes limits the total number of dbms_scheduler

and dbms_job jobs that can be running at a given time.

To check whether this is the case check the current value of

job_queue_processes with

SQL> select value from v$parameter where name='job_queue_processes';

Then check the number of running jobs

SQL> select count(*) from dba_scheduler_running_jobs;

SQL> select count(*) from dba_jobs_running;



If this is the problem you can increase the parameter using

SQL> alter system set job_queue_processes=1000;



2) max_job_slave_processes may be too low

If this parameter is not NULL then it limits how many dbms_scheduler jobs can

be running at a time. To check whether this is the problem, check the current

value using

SQL> select value from dba_scheduler_global_attribute

where attribute_name='MAX_JOB_SLAVE_PROCESSES';

Then check the number of running jobs

SQL> select count(*) from dba_scheduler_running_jobs;



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)



3) sessions may be too low

This parameter limits the number of sessions at any time. Every Scheduler job

requires 2 sessions. To check whether this is the problem, check the current

valule using

SQL> select value from v$parameter where name='sessions';

Then check the current number of sessions using

SQL> select count(*) from v$session ;



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.



If it throws a timezone warning, reapply the upgrade or

timezone patch making sure to follow all the steps.



5) Is the database running in restricted mode ?

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 ;



If logins is restricted you can disable the restricted mode using

SQL> ALTER SYSTEM DISABLE RESTRICTED SESSION;



6) Is the job scheduled to run on an instance which is down ?



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.



8) Is the Resource Manager in effect with a restrictive resource plan ?



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



SQL> select name from V$RSRC_PLAN ;



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



SQL>alter system set resource_manager_plan = '';





9) Has the Scheduler been disabled ? This is not a supported action

but it is possible that someone has done it anyway. To check this do

SQL> select value from dba_scheduler_global_attribute where attribute_name='SCHEDULER_DISABLED'



If this query returns TRUE then you can fix this using

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



Reasons why jobs may run late



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 get a list of maintenance windows use

SQL> select * from dba_scheduler_wingroup_members;



To see when the windows run use

SQL> select * from dba_scheduler_windows;



To fix this you can either increase the limits or reschedule the maintenance

windows to run at more convenient times.



Diagnosing other Problems



If none of this works, here are some further steps you can take to try to

figure out what is going on.



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".



2) Check whether if a job coordinator trace file and if it does, check if it

contains any errors. If this exists, it will be located in the

'background_dump_dest' directory which you can find as above and will look

something like SID-cjq0_nnnn.trc . If there are any errors here they may

hint at why jobs are not running.



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');



5)try running a simple run-once job and see if it runs

SQL>begin

dbms_scheduler.create_job (

job_name => 'test_job',

job_type => 'plsql_block',

job_action => 'null;',

enabled => true);

end;

/

SQL> -- wait a while

SQL> select * from user_scheduler_job_run_details where job_name='TEST_JOB';



6) If a simple run-once job doesn't run, you can try restarting the scheduler as follows.



SQL> exec dbms_scheduler.set_scheduler_attribute('SCHEDULER_DISABLED', 'TRUE');

SQL> alter system set job_queue_processes=0;

SQL> exec dbms_ijob.set_enabled(FALSE);

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');

Answers to "Why are my jobs not running?"的更多相关文章

  1. & fg jobs bg

    & 执行程序的后面加&可以将程序转到后台(这个后台是当前会话的后台,并不是守护进程)执行,即$./a.out &,这样我们在打开诸如$gedit test.txt的时候可以写成 ...

  2. Managing linux Shell Jobs

    Managing Shell Jobs   When moving jobs between the foreground and background, it may be useful to ha ...

  3. nohup命令与&区别,jobs,fg,bg,Ctrl-Z、Ctrl-C、Ctrl-D

    &方式: Unix/Linux下一般想让某个程序在后台运行,很多都是使用 & 在程序结尾来让程序自动运行.比如我们要运行mysql在后台:          /usr/local/my ...

  4. linux fg bg ctrl + z jobs & 等命令

    fg.bg.jobs.&.ctrl + z都是跟系统任务有关的,虽然现在基本上不怎么需要用到这些命令,但学会了也是很实用的一.& 最经常被用到这个用在一个命令的最后,可以把这个命令放到 ...

  5. Linux scp 设置nohup后台运行

    Linux scp 设置nohup后台运行 1.正常执行scp命令 2.输入ctrl + z 暂停任务 3.bg将其放入后台 4.disown -h 将这个作业忽略HUP信号 5.测试会话中断,任务继 ...

  6. Hadoop-1.2.1 升级到Hadoop-2.6.0 HA

      Hadoop-1.2.1到Hadoop-2.6.0升级指南   作者 陈雪冰 修改日期 2015-04-24 版本 1.0     本文以hadoop-1.2.1升级到hadoop-2.6.0 Z ...

  7. Linux 任务控制

    Linux/Unix 提供了不同与 windows 的多任务处理,也提供一套用来切换前后台任务的命令 bg fg & Ctrl+z nohup sitsid Ctrl-Z 挂起程序 user@ ...

  8. 16061701(地图灯光编译Beast报错)

    [目标] 地图灯光编译报错 [思路] 1 我自己测c2_cwd_rt 附件为当时log 2 ExampleGame\BeastCache\PersistentCache 3 重新删除掉BeastCac ...

  9. 2016-09-19: linux后台运行

    linux后台运行命令两种方式: 1. command & : 后台运行,你关掉终端会停止运行   2. nohup command & : 后台运行,你关掉终端也会继续运行 简介 L ...

随机推荐

  1. Tcl与Design Compiler (一)——前言

    已经学习DC的使用有一段时间了,在学习期间,参考了一些书,写了一些总结.我也不把总结藏着掖着了,记录在博客园里面,一方面是记录自己的学习记录,另一方面是分享给大家,希望大家能够得到帮助.参考的书籍有很 ...

  2. 初识JavaScript闭包

    一个问题引发的思考 在我学习javascript的事件时,有一个小任务是使用JS来实现 li 列表项在鼠标悬浮时会有背景阴影的动态效果,很自然想到用for 来为每个列表项添加onmouseover 和 ...

  3. TreeMap就这么简单【源码剖析】

    前言 声明,本文用得是jdk1.8 前面章节回顾: Collection总览 List集合就这么简单[源码剖析] Map集合.散列表.红黑树介绍 HashMap就是这么简单[源码剖析] LinkedH ...

  4. angulajs_删除功能

  5. 学习React系列(五)——使性能最优

    提高性能可分为两方面: 一.配置层面 二.代码层面 本文只从代码层面考虑: 一.避免重复渲染 这里要说一句: 当shouldComponentUpdate返回false的时候不触发render函数也就 ...

  6. Mac安装opencv指南

      最近接到了新的调研任务.主要是和人脸,各种所谓'AI'相关的.因为这里要处理视频和图像.于是在网上看到很多资料都是关于opencv的所以准备用opencv来开发这些东西.既然要用到opencv.那 ...

  7. python入门编程之三级菜单编程

    菜单实现功能输入一层显示下一层菜单不论在哪层输入b返回上一层不论在哪层输入q退出菜单此代码通过利用字典的知识可以实现_Author_ = 'jc'data = { '北京':{ '昌平':{ '沙河' ...

  8. 分析 ajax 请求并抓取今日头条街拍美图

    首先分析街拍图集的网页请求头部: 在 preview 选项卡我们可以找到 json 文件,分析 data 选项,找到我们要找到的图集地址 article_url: 选中其中一张图片,分析 json 请 ...

  9. [ZJOI 2008]泡泡堂BNB

    Description 题库链接 双方 \(n\) 人,给出每人的战斗力,赢一场加 \(2\) 分,平局 \(1\) 分,失败不得分.求最大和最小的得分. \(1\leq n\leq 100000\) ...

  10. [HDU 2036]改革春风吹满地

    Description “ 改革春风吹满地,不会AC没关系;实在不行回老家,还有一亩三分地.谢谢!(乐队奏乐)”话说部分学生心态极好,每天就知道游戏,这次考试如此简单的题目,也是云里雾里,而且,还竟然 ...