【Oracle】ORA-23421: job number XXXX is not a job in the job queue
檢查一個資料庫的alert日誌時,檢視一些job報錯,由於是自己的測試庫,考慮把job停止掉。但是遇到如下錯誤:
sys@im1>exec DBMS_JOB.broken(275,true);
BEGIN DBMS_JOB.broken(275,true); END;
*
ERROR at line 1:
ORA-23421: job number 275 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 245
ORA-06512: at line 1
檢視了資料說:不是job的owner的使用者delete,remove,broken 一個job時,會報錯:ORA-23421: job number XXXX is not a job in the job queue
只有job的owner才能夠對job進行修改變更。
但是查詢找到job的owner priv_user
sys@im1>select job, what, log_user, priv_user,broken from dba_jobs where job=275;
JOB WHAT LOG_USER PRIV_USER B
---------- ---------------------------------------- ---------- ---------- -
275 WEB_SMS.cleanAppBuffer; SYSTEM SYSTEM N
2.以上面的sql語句priv_user登入資料庫
system@im1>exec DBMS_JOB.broken(295,false);
PL/SQL procedure successfully completed.
3.執行如下語句:
system@im1>exec DBMS_JOB.broken(295,true);
PL/SQL procedure successfully completed.
system@im1>commit;
Commit complete.
system@im1>select job, log_user, priv_user,broken from dba_jobs where job in (295);
JOB LOG_USER PRIV_USER B
---------- ---------- ---------- -
295 SYSTEM SYSTEM Y
另一種方法是以sys使用者:
sys@im1>exec DBMS_IJOB.broken(275,true);
PL/SQL procedure successfully completed.
sys@im1>select job, what, log_user, priv_user,broken from dba_jobs where job=275;
JOB WHAT LOG_USER PRIV_USER B
---------- ---------------------------------------- ---------- ---------- -
275 WEB_SMS.cleanAppBuffer; SYSTEM SYSTEM Y
sys@im1>exec DBMS_IJOB.broken(275,false);
PL/SQL procedure successfully completed.
sys@im1>select job, what, log_user, priv_user,broken from dba_jobs where job=275;
JOB WHAT LOG_USER PRIV_USER B
---------- ---------------------------------------- ---------- ---------- -
275 WEB_SMS.cleanAppBuffer; SYSTEM SYSTEM N
嘗試以system使用者執行命令此命令,會報錯:
system@im1>exec DBMS_IJOB.broken(295,false);
BEGIN DBMS_IJOB.broken(295,false); END;
*
ERROR at line 1:
ORA-06550: line 1, column 7:
PLS-00201: identifier 'DBMS_IJOB.BROKEN' must be declared
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored
參考文章:
DBMS_JOB Remove Procedure Fails With ORA-23421 [ID 452864.1]
ORA-23421 OR ORA-03421 TRYING TO ALTER A JOB [ID 1029977.6]
ORA-23421: job number is not a job in the job queue when dropping an existing job [ID 1214884.1]
最後一篇文章介紹當job$的索引INDEX I_JOB_JOB 損壞,也會導致此錯誤,對索引進行重建即可!
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/28211342/viewspace-2156211/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- job_queue_processes引數 job關係
- oracle建立job並執行jobOracle
- oracle jobOracle
- Python程式碼解析: job = next(job for job in jobs if job.job_id == job_id)Python
- 【JOB】Oracle JOB全面學習(DBMS_JOB和DBMS_SCHEDULER)Oracle
- ORACLE查詢JOB資訊及JOB建立Oracle
- Oracle中如何停用JOB及如何使用JOBOracle
- oracle job用法Oracle
- oracle job管理Oracle
- oracle job管理(zt)Oracle
- oracle 定義jobOracle
- Oracle JOB的使用Oracle
- Oracle job備忘Oracle
- oracle job的用法Oracle
- oracle job 介紹Oracle
- oracle job 用法2Oracle
- Oracle中的jobOracle
- Oracle job 管理(轉)Oracle
- ORCLE 如何停止一個JOB【HOW TO STOP A JOB IN THE ORACLE?】薦Oracle
- oracle job_相關Oracle
- Oracle JOB 用法小結Oracle
- Oracle JOB 建立例項Oracle
- oracle中Job的操作Oracle
- Oracle Job 小結(ZT)Oracle
- Oracle JOB 使用方法Oracle
- 停掉oracle自帶jobOracle
- java jobJava
- 用 Go 語言 buffered channel 實作 Job QueueGo
- 用 Go 語言實作 Job Queue 機制Go
- 批量刪除dbms_job建立的job
- oracle10g job 相關-dbms_scheduler.create_job(轉載)Oracle
- oracle job使用詳解及job不執行的檢查方法Oracle
- Oracle資料庫——Scheduler JobOracle資料庫
- oracle DBMS_SCHEDULER_job 管理Oracle
- Oracle Job 遷移小記Oracle
- Oracle手工修改JOB屬性Oracle
- 【轉】Oracle JOB 用法小結Oracle
- how to kill the runing job in ORACLEOracle