Oracle Job ORA-12005 錯誤的解決
最近發現兩個資料庫每天晚上23:55分都有警告日誌的報錯資訊:
Wed Sep 24 23:55:04 2008
Errors in file /oracle/app/oracle/admin/gdimall/bdump/gdimall_j001_4043.trc:
ORA-12012: error on auto execute of job 3
ORA-12005: may not schedule automatic refresh for times in the past
Wed Sep 24 23:57:09 2008
Errors in file /oracle/app/oracle/admin/gdimall/bdump/gdimall_j001_4043.trc:
ORA-12012: error on auto execute of job 3
ORA-12005: may not schedule automatic refresh for times in the past
[@more@]檢視trace檔案:
gd_idb01:[/oracle/app/oracle/admin/gdimall/bdump$]cat /oracle/app/oracle/admin/gdimall/bdump/gdimall_j001_4043.trc
/oracle/app/oracle/admin/gdimall/bdump/gdimall_j001_4043.trc
Oracle9i Enterprise Edition Release 9.2.0.6.0 - 64bit Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.6.0 - Production
ORACLE_HOME = /oracle/app/oracle/product/9.2.0
System name: HP-UX
Node name: gd_idb01
Release: B.11.11
Version: U
Machine: 9000/800
Instance name: gdimall
Redo thread mounted by this instance: 1
Oracle process number: 147
Unix process pid: 4043, image: oracle@gd_idb01 (J001)
*** SESSION ID:(782.45392) 2008-09-24 23:55:04.144
*** 2008-09-24 23:55:04.144
ORA-12012: error on auto execute of job 3
ORA-12005: may not schedule automatic refresh for times in the past
*** SESSION ID:(782.45400) 2008-09-24 23:57:09.407
*** 2008-09-24 23:57:09.407
ORA-12012: error on auto execute of job 3
ORA-12005: may not schedule automatic refresh for times in the past
檢視相關的job:
SQL>select job,log_user,schema_user,what,LAST_DATE,LAST_SEC,THIS_DATE,THIS_SEC,NEXT_DATE,NEXT_SEC,INTERVAL from dba_jobs where job=3;
JOB LOG_USER SCHEMA_USER
---------- ------------------------------ ------------------------------
WHAT
--------------------------------------------------------------------------------
LAST_DATE LAST_SEC THIS_DATE THIS_SEC NEXT_DATE NEXT_SEC
--------- ---------------- --------- ---------------- --------- ----------------
INTERVAL
--------------------------------------------------------------------------------
3 COMP_EAF COMP_EAF
P_LOGIN_STATISTICS();
25-SEP-08 00:01:14 25-SEP-08 23:55:00
trunc(sysdate)+1435/1440
發現interval是trunc(sysdate)+1435/1440。在檢視all_jobs中,以下列的含義為:
(a)LAST_DATE:Date on which this job last successfully executed——job成功執行的完畢時間
(b)LAST_SEC:Same as LAST_DATE. This is when the last successful execution started.--上次成功執行的開始時間
(c)THIS_DATE:Date that this job started executing (usually null if not executing)——沒有job在執行的時候,該欄位為空。若有job正在執行,這個時間是job的開始執行時間。
(d)THIS_SEC:Same as THIS_DATE. This is when the last successful execution started.
(e)NEXT_DATE:Date that this job will next be executed——job下次執行時間。
(f)NEXT_SEC:Same as NEXT_DATE. This is when the last successful execution started。
(g)INTERVAL:A date function, evaluated at the start of execution, becomes next NEXT_DATE
對於該INTERVAL引數如上例:job 3執行時間為9月24日23:55,那麼如果interval是trunc(sysdate)+1435/1440,因此,next date就是把job的開始時間23:55,代入到interval中的sysdate,得到的結果就仍然是9月24日的23:55。而next date的更新,是一次job完成時更新的,比如job在9月24日的1:14完成,於是在更新next date的時候,就發現next date的時間晚於當前的時間,於是就報錯may not schedule automatic refresh for times in the past。而事實上,job應該是成功執行了的。為了解決這個報錯,interval改成trunc(sysdate+1)+1435/1440。
conn COMP_EAF/COMP_EAF
begin
sys.dbms_job.change(job => 3,
what => 'P_LOGIN_STATISTICS();',
next_date => to_date('2008-09-25 23:55:00', 'yyyy-mm-dd hh24:mi:ss'),
interval => 'trunc(sysdate+1)+1435/1440');
commit;
end;
/
說明,執行的時候,如果以sys執行可以會報以下錯誤,以all_jobs中shema_user連線執行即可。
ERROR at line 1:
ORA-23421: job number 64 is not a job in the job queue
ORA-06512: at "SYS.DBMS_SYS_ERROR", line 86
ORA-06512: at "SYS.DBMS_IJOB", line 529
ORA-06512: at "SYS.DBMS_JOB", line 204
ORA-06512: at "SYS.DBMS_JOB", line 185
ORA-06512: at line 2
http://blog.163.com/ansel_zlh/blog/static/103727172008825113225901/
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/18841027/viewspace-1020645/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- ORA-12005 錯誤的解決
- 連線oracle錯誤解決辦法Oracle
- 【Oracle】ORA-00054 錯誤解決方法Oracle
- 【oracle 錯誤及解決】ORA-39139Oracle
- oracle 1455 錯誤解決辦法Oracle
- oracle錯誤及解決方式集(轉)Oracle
- 案例: 解決ORACLE ORA-27211的錯誤Oracle
- ORACLE匯入遇到ORACLE錯誤959解決方法Oracle
- oracle ORA-12899錯誤的解決方法Oracle
- Oracle 常見的錯誤問題及解決方法Oracle
- Job for mysqld.service failed because the control process exited with error code錯誤解決MySqlAIError
- Ocelot錯誤解決
- ORACLE常見錯誤程式碼的分析與解決(轉)Oracle
- Oracle 錯誤總結及問題解決 ORAOracle
- 【oracle 錯誤及解決】ORA-01659Oracle
- Oracle 資料庫連線錯誤解決方法Oracle資料庫
- linux oracle 建立informix dblink 錯誤解決LinuxOracleORM
- 解決IE上登陸oracle OEM時報:“證書錯誤,導航已阻止”的錯誤Oracle
- undefined reference to錯誤的解決方法Undefined
- SAXParseException的錯誤解決之二Exception
- PHP錯誤“Thisfilehasexpired”的解決方法PHP
- VIM 常用錯誤解決
- sqldeveloper for windows 錯誤解決SQLDeveloperWindows
- Oracle的TNS-12502 錯誤原因及解決Oracle
- ORACLE11g DataGuard手工建立錯誤的解決方案(一)Oracle
- ORACLE11g DataGuard手工建立錯誤的解決方案(二)Oracle
- Oracle ORA-01103 錯誤的解決辦法Oracle
- Linux下安裝oracle,遇到錯誤的解決辦法LinuxOracle
- Oracle跨版本匯出EXP-00003錯誤的解決()Oracle
- Oracle EBS 打中文補丁錯誤 的一個解決方法Oracle
- ORACLE11G解決ORA-00845錯誤Oracle
- Oracle資料庫配置錯誤資訊解決方法(轉)Oracle資料庫
- [Oracle] ORA-03113錯誤分析與解決Oracle
- oracle之EXP匯出表空間錯誤解決Oracle
- dns錯誤怎麼辦 dns錯誤的解決辦法DNS
- Oracle中JOB的建立後不執行解決方法Oracle
- oracle ora-12514的錯誤的解決辦法Oracle
- 解決oracle 11g+xp的一個不常見的錯誤Oracle