scheduler一直執行超過30分鐘的作業監控

lusklusklusk發表於2017-05-25
create or replace procedure sp_scheduler_check as
x number;
begin
select round((select (sysdate-(select to_date((select * from (select to_char(log_date,'YYYY-MM-DD HH24:MI:SS') from user_scheduler_job_run_details where job_name='XXX' order by log_id desc) where rownum<2),'YYYY-MM-DD HH24:MI:SS') from dual))*24*60 from dual),0) into x from dual;


if x>30 then


begin
SEND_EMAIL  ('<ERP_admin@yuusei.cn>'
,'<luxus.liao@mic.com.tw;luxus.liao@mic.com.tw;horuse.yu@mic.com.tw>'
,'JIECHENG SCHEDULUER NEED CHECK >30'
,'JIECHENG SCHEDULUER NEED CHECK,SID.SEREAL SHOUD KILL');
end;
end if;
exception when others then
  dbms_output.put_line(sqlcode);
  rollback;
end;

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/30126024/viewspace-2139886/,如需轉載,請註明出處,否則將追究法律責任。

相關文章