dbms_scheduler 创建作业未运行作业 [英] dbms_scheduler Create Job Not running Job
问题描述
我正在尝试通过 dbms_scheduler 运行一个过程,但它刚刚被创建但没有运行.数据库版本使用Oracle 11.2.x
I am trying to run a procedure through a dbms_scheduler but it is just getting created but not running. DataBase Version Used Oracle 11.2.x
程序
create or replace procedure count_comp
as
Total_count number;
begin
select count(*) into Total_count from user_tables;
dbms_output.put_line('Number '|| Total_count);
end;
创建工作
BEGIN
DBMS_SCHEDULER.CREATE_JOB (
job_name => 'My_Count_Job',
job_type => 'STORED_PROCEDURE',
job_action => 'count_comp',
start_date => '28-APR-08 07.00.00 PM Asia/Calcutta',
repeat_interval => 'FREQ=DAILY;INTERVAL=2', /* every other day */
auto_drop => FALSE,
enabled =>TRUE,
comments => 'My new job');
END;
/
推荐答案
一些可能的原因如下所述.job_queue_processes 可能太低检查执行下面的查询select value from v$parameter where name='job_queue_processes';
Some of the possible Reasons as mentioned below. job_queue_processes may be too low To check Execute below query select value from v$parameter where name='job_queue_processes';
然后检查正在运行的作业数
Then check the number of running jobs
select count(*) from dba_scheduler_running_jobs;
select count(*) from dba_jobs_running;
如果这是问题,您可以使用
If this is the problem you can increase the parameter using
alter system set job_queue_processes=1000;
2) max_job_slave_processes 可能太低如果此参数不为 NULL,则它限制了 dbms_scheduler 作业的数量一次运行.检查 w
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 w
select value from dba_scheduler_global_attribute
where attribute_name='MAX_JOB_SLAVE_PROCESSES';
然后检查正在运行的作业数
Then check the number of running jobs
select count(*) from dba_scheduler_running_jobs;
如果这是问题,您可以增加数字或使用
If this is the problem you can increase the number or just NULL it out using
exec dbms_scheduler.set_scheduler_attribute('max_job_slave_processes',null)
3) 会话次数可能太少
3) sessions may be too low
4) 检查调度器是否被禁用
4) Check if the Scheduler been disabled
select value from dba_scheduler_global_attribute where attribute_name='SCHEDULER_DISABLED'
如果此查询返回 TRUE,则您可以使用SQL> exec dbms_scheduler.set_scheduler_attribute('scheduler_disabled','false');
If this query returns TRUE then you can fix this using
SQL> exec dbms_scheduler.set_scheduler_attribute('scheduler_disabled','false');
这篇关于dbms_scheduler 创建作业未运行作业的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!