【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/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Python程式碼解析: job = next(job for job in jobs if job.job_id == job_id)Python
- oracle job管理(zt)Oracle
- ORACLE dbms_scheduler.create_job建立job作業遭遇PLS-00306Oracle
- Sqoop jobOOP
- 用 Go 語言 buffered channel 實作 Job QueueGo
- 用 Go 語言實作 Job Queue 機制Go
- Oracle中job的使用詳解Oracle
- 單體JOB向分散式JOB遷移案例分散式
- job設計
- XXL-Job與Elastic-Job詳細對比AST
- 【Oracle】簡單引數也有講究,JOB_QUEUE_PROCESS引數調研Oracle
- Oracle資料庫定時器JobOracle資料庫定時器
- XXL JOB DockerCompose部署Docker
- Web Development Job in 4Webdev
- kubernetes物件之Job物件
- Jenkins Job遷移Jenkins
- job任務均不執行,手工執行報job now running
- Xxl-job安裝部署以及SpringBoot整合Xxl-job使用Spring Boot
- 關於Quartz的Job 不能被注入以及SpringAop對Job失效quartzSpring
- 使用Elastic Job的時候報“Job conflict with register center”,如何處理?AST
- Helm部署xxl-job
- Databricks 第10篇:Job
- Quartz job scheduler 學習quartz
- Oracle 定時任務job實際應用Oracle
- Oracle診斷案例-Job任務停止執行Oracle
- 使用oracle job定時傳送email郵件OracleAI
- Elasticjob執行job冪等AST
- xxl-job心跳機制
- Spring Boot 整合 xxl-jobSpring Boot
- Hive On Tez自定義Job NameHive
- 巧妙設定job的interval
- 網路安全成Top Job
- zsh fg: no job control in this shell.
- XXL-JOB定時任務框架(Oracle定製版)框架Oracle
- 從promise、process.nextTick、setTimeout出發,談談Event Loop中的Job queuePromiseOOP
- yarn-per-job提交流程Yarn
- [20190531]建立job與commit.txtMIT
- EA Job Listing: Madden Could Be Coming to a Switch