oracle schedule 任務失敗處理
故障現象:
收到zabbix告警郵件,具體內容如下:
告警內容:
ZABBIX-監控系統:
------------------------------------
報警內容: Found failed scheduler jobs
------------------------------------
報警級別: PROBLEM
------------------------------------
監控專案: app_job_fail_cnt:1
------------------------------------
報警時間:2016.11.04-10:43:05
故障原因:
由於有個專案的DB下線,而這個db的部分表資料需要同步到另一資料庫(統計庫),統計庫有定時任務定期同步資料,一旦下線DB關閉,統計庫定時任務同步資料失敗,從而觸發郵件告警。
故障處理過程:
檢視失敗Job資訊
select log_id,log_date,owner,job_name,status from dba_scheduler_job_log where status = 'FAILED' ;
626593 04-11月-16 10.17.52.065773 上午 +08:00 ASTA_STAT SYN_SERINFO FAILED
禁用失敗job
exec dbms_scheduler.disable('DBUSER.SYN_SERINFO') ;
刪除失敗日誌:(由於dba_scheduler_job_log是檢視,根據其SQL找到對應的物理表,然後刪除資料)
SQL> delete from dba_scheduler_job_log where status = 'FAILED' ;
delete from dba_scheduler_job_log where status = 'FAILED'
*
ERROR at line 1:
ORA-01752: cannot delete from view without exactly one key-preserved table
select owner,object_type from dba_objects where object_name=upper('dba_scheduler_job_log');
SYS VIEW
PUBLIC SYNONYM
CREATE OR REPLACE VIEW SYS.DBA_SCHEDULER_JOB_LOG AS
(SELECT
LOG_ID, LOG_DATE, OWNER,
DECODE(instr(e.NAME,'"'),0, e.NAME,substr(e.NAME,1,instr(e.NAME,'"')-1)),
DECODE(instr(e.NAME,'"'),0,NULL,substr(e.NAME,instr(e.NAME,'"')+1)),
co.NAME, OPERATION,e.STATUS, USER_NAME, CLIENT_ID, GUID,
decode(e.credential, NULL, NULL,
substr(e.credential, 1, instr(e.credential, '"')-1)),
decode(e.credential, NULL, NULL,
substr(e.credential, instr(e.credential, '"')+1,
length(e.credential) - instr(e.credential, '"'))),
decode(bitand(e.flags, 1), 0, NULL,
substr(e.destination, 1, instr(e.destination, '"')-1)),
decode(bitand(e.flags, 1), 0, e.destination,
substr(e.destination, instr(e.destination, '"')+1,
length(e.destination) - instr(e.destination, '"'))),
ADDITIONAL_INFO
FROM scheduler$_event_log e, obj$ co
WHERE e.type# = 66 and e.dbid is null and e.class_id = co.obj#(+));
根據物理表刪除日誌
select object_name,object_type ,owner from dba_objects where object_name=upper('scheduler$_event_log');
select * from sys.SCHEDULER$_EVENT_LOG where status='FAILED';
DELETE FROM sys.SCHEDULER$_EVENT_LOG where status='FAILED';
commit;
擴充套件:
oracle 定時任務管理,請參考之前的文章
http://blog.itpub.net/27067062/viewspace-2127806/
收到zabbix告警郵件,具體內容如下:
告警內容:
ZABBIX-監控系統:
------------------------------------
報警內容: Found failed scheduler jobs
------------------------------------
報警級別: PROBLEM
------------------------------------
監控專案: app_job_fail_cnt:1
------------------------------------
報警時間:2016.11.04-10:43:05
故障原因:
由於有個專案的DB下線,而這個db的部分表資料需要同步到另一資料庫(統計庫),統計庫有定時任務定期同步資料,一旦下線DB關閉,統計庫定時任務同步資料失敗,從而觸發郵件告警。
故障處理過程:
檢視失敗Job資訊
select log_id,log_date,owner,job_name,status from dba_scheduler_job_log where status = 'FAILED' ;
626593 04-11月-16 10.17.52.065773 上午 +08:00 ASTA_STAT SYN_SERINFO FAILED
禁用失敗job
exec dbms_scheduler.disable('DBUSER.SYN_SERINFO') ;
刪除失敗日誌:(由於dba_scheduler_job_log是檢視,根據其SQL找到對應的物理表,然後刪除資料)
SQL> delete from dba_scheduler_job_log where status = 'FAILED' ;
delete from dba_scheduler_job_log where status = 'FAILED'
*
ERROR at line 1:
ORA-01752: cannot delete from view without exactly one key-preserved table
select owner,object_type from dba_objects where object_name=upper('dba_scheduler_job_log');
SYS VIEW
PUBLIC SYNONYM
CREATE OR REPLACE VIEW SYS.DBA_SCHEDULER_JOB_LOG AS
(SELECT
LOG_ID, LOG_DATE, OWNER,
DECODE(instr(e.NAME,'"'),0, e.NAME,substr(e.NAME,1,instr(e.NAME,'"')-1)),
DECODE(instr(e.NAME,'"'),0,NULL,substr(e.NAME,instr(e.NAME,'"')+1)),
co.NAME, OPERATION,e.STATUS, USER_NAME, CLIENT_ID, GUID,
decode(e.credential, NULL, NULL,
substr(e.credential, 1, instr(e.credential, '"')-1)),
decode(e.credential, NULL, NULL,
substr(e.credential, instr(e.credential, '"')+1,
length(e.credential) - instr(e.credential, '"'))),
decode(bitand(e.flags, 1), 0, NULL,
substr(e.destination, 1, instr(e.destination, '"')-1)),
decode(bitand(e.flags, 1), 0, e.destination,
substr(e.destination, instr(e.destination, '"')+1,
length(e.destination) - instr(e.destination, '"'))),
ADDITIONAL_INFO
FROM scheduler$_event_log e, obj$ co
WHERE e.type# = 66 and e.dbid is null and e.class_id = co.obj#(+));
根據物理表刪除日誌
select object_name,object_type ,owner from dba_objects where object_name=upper('scheduler$_event_log');
select * from sys.SCHEDULER$_EVENT_LOG where status='FAILED';
DELETE FROM sys.SCHEDULER$_EVENT_LOG where status='FAILED';
commit;
擴充套件:
oracle 定時任務管理,請參考之前的文章
http://blog.itpub.net/27067062/viewspace-2127806/
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/27067062/viewspace-2127815/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Spark 叢集執行任務失敗的故障處理Spark
- oracle對JOB失敗的處理Oracle
- Oracle DG同步失敗故障處理(二)Oracle
- schedule 定時任務
- 【Ansible】ansible任務失敗控制
- mysql計劃任務:event scheduleMySql
- postgresql連線失敗如何處理SQL
- svn dump 失敗後的處理
- python 定時任務之 schedulePython
- online 建立索引失敗處理索引
- js播放背景音樂失敗處理JS
- PHP 多程式處理任務PHP
- Service Worker 圖片載入失敗處理
- php上傳大檔案失敗處理PHP
- 處理service named start失敗failed_dnsAIDNS
- OracleDBConsole啟動失敗處理Oracle
- 索引rebuild online失敗後處理索引Rebuild
- Windows 2008 r2任務計劃程式執行批處理失敗問題解決方法Windows
- Laravel-Schedule 計劃任務「原理了解」Laravel
- LiteOS核心原始碼分析:任務LOS_Schedule原始碼
- Android 中高效執行Schedule 任務(譯)Android
- python的django安裝失敗如何處理PythonDjango
- linux swap掛載失敗問題處理Linux
- AndroidKiller反編譯失敗的處理方法Android編譯
- 啟用系統登入失敗處理功能
- goldengate ddl_setup執行失敗處理Go
- Jenkins執行批處理檔案失敗Jenkins
- OEM分析TNSNAME.ORA檔案失敗處理
- PHP CLI 模式多子程式任務處理PHP模式
- .bat批處理新增Python任務BATPython
- AsyncTask 處理複雜多個任務。
- Java中的任務超時處理Java
- Mac openssl 未找到 / 載入失敗問題處理Mac
- Linux Yum 安裝失敗處理過程整理Linux
- en_concat函式編譯失敗處理函式編譯
- 某省ORACLE10G RAC資料庫CRS啟動失敗問題處理Oracle資料庫
- Python定時任務輕量解決方案---SchedulePython
- 【面試普通人VS高手系列】Dubbo的服務請求失敗怎麼處理?面試