ORACLE有一種定時調度機制
設置的JOB就是不運行
最好執行了這個才搞定 exec dbms_ijob
下面提供一個checklist用於檢查job異常的原因
Check if the instance is in restricted sessions mode:
select instance_name
If logins=RESTRICTED
alter system disable restricted session;
^– Checked!
Make sure that job_queue_processes is >
show parameter job_queue_processes
^– Checked!
Check if _system_enabled_trigger=false
col parameter format a
col value format a
select a
where a
If _system_trig_enabled=false
alter system set
^– Checked!
select job
If broken
^– Checked! The job is not broken
Make sure a commit is issued after submitting the job:
DECLARE X NUMBER;
BEGIN
SYS
(
job => X
(
);
COMMIT;
END;
/
If the job executes fine if forced (i
is missing
^– Checked! The job is committed after submission
Check if the server (machine) has been up for more than
For SUN
If uptime>
(Jobs may stop running after
^– Checked! The server in this case has been up
Check dba_jobs_running to see if the job is still running:
select * from dba_jobs_running;
^– Checked! The job is not running
LAST_DATE and NEXT_DATE
Check if the last_date and next_date for the job are proper:
select Job
^– NEXT_DATE is porper
Check if the Next_date is changing properly as per the interval set in dba_jobs:
select Job
^– This is not possible since the job never gets executed automatically
Stop and restart CJQ process(es)
alter system set job_queue_processes=
–<Wait for some time to ensure CJQ process stopped>
alter system set job_queue_processes=
Ref: Bug
^– Done but did not help
Last ditch effort
Either restart the database or try the following:
exec dbms_ijob
Ref: Bug
Done but did not help
These are the most common causes for this behavior
Solution
The solution ended up to be the server (machine) uptime
Even though it was up for only
To implement the solution
from metalink docs
From:http://tw.wingwit.com/Article/program/Oracle/201311/16944.html