重庆思庄Oracle、Redhat认证学习论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 277|回复: 0
打印 上一主题 下一主题

[参考文档] Querying DBA_JOBS Encounter ORA-01873 (Doc ID 2710794.1)

[复制链接]
跳转到指定楼层
楼主
发表于 2024-10-31 15:36:48 | 只看该作者 回帖奖励 |正序浏览 |阅读模式
In this Document
Symptoms
Changes
Cause
Solution
References


APPLIES TO:
Oracle Database - Enterprise Edition - Version 19.0.0.0 and later
Information in this document applies to any platform.
SYMPTOMS
Querying DBA_JOBS encounter ORA-01873 in 19c.




    ORA-01873: the leading precision of the interval is too small
CHANGES
Upgrade to 19c.


CAUSE
Please note that Scheduler will not track the TOTAL_TIME for Job.



Database Preupgrade tool check list. (Doc ID 2380601.1)
Starting with Oracle Database 19c, jobs created and managed through DBMS_JOB package in previous database versions
will be re-created using Oracle Scheduler architecture. Jobs not successfully re-created may not function properly after upgrade.


In 19c, the definition of the TOTAL_TIME field in dba_jobs is as follows:


  (CASE WHEN j.last_end_date>j.last_start_date THEN
   extract(day from (j.last_end_date-j.last_start_date)*86400) ELSE 0 END)
   TOTAL_TIME, -- Scheduler does not track total time
For the above formula, if the gap between last_end_date and last_start_date is more than 7 hours, and the difference is multiplied by 86400, it will exceed the precision of 9-digit integer, and an error ORA-01873 will be reported.


SQL> select extract(day from (cast( to_date('21-12-21 17:15:09','yy-mm-dd hh24:mi:ss') as timestamp) - cast( to_date('21-12-21 11:15:09','yy-mm-dd hh24:mi:ss') as timestamp))*86000) from dual;


EXTRACT(DAYFROM(CAST(TO_DATE('21-12-2117:15:09','YY-MM-DDHH24:MI:SS')ASTIMESTAMP
--------------------------------------------------------------------------------
                                                                          21500


SQL> select extract(day from (cast( to_date('21-12-21 17:15:09','yy-mm-dd hh24:mi:ss') as timestamp) - cast( to_date('21-12-21 10:15:09','yy-mm-dd hh24:mi:ss') as timestamp))*86000) from dual;
select extract(day from (cast( to_date('21-12-21 17:15:09','yy-mm-dd hh24:mi:ss') as timestamp) - cast( to_date('21-12-21 10:15:09','yy-mm-dd hh24:mi:ss') as timestamp))*86000) from dual
                                                                                                                                                                        *
ERROR at line 1:
ORA-01873: the leading precision of the interval is too small
Therefore, if the dictionary data is upgrade/migrate to 19c, ORA-01873 may occur.


SOLUTION
Please ignore column TOTAL_TIME and select other columns to get the information from querying DBA_JOBS.


OR


Querying dba_scheduler_jobs and you will see all of the jobs  that were created using dbms_job.


    select * from dba_scheduler_jobs;




分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏 支持支持 反对反对
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|手机版|小黑屋|重庆思庄Oracle、Redhat认证学习论坛 ( 渝ICP备12004239号-4 )

GMT+8, 2024-11-25 00:55 , Processed in 0.128832 second(s), 21 queries .

重庆思庄学习中心论坛-重庆思庄科技有限公司论坛

© 2001-2020

快速回复 返回顶部 返回列表