os:rhel6.8 64 2.6.32
db:oracle 11.2.0.3.11 rac

执行DBMS_SQLTUNE优化sql或dbms_stats收集统计信息报错:ORA-20003: Specified bug number (16470836) does not exist
这个错误很早之前就遇到了,当时查了mos,已经大概找到原因。但是一直没有停机窗口来维护。这次在执行DBMS_SQLTUNE优化sql时又遇上了,这里做一个简单的记录。

这套系统是从windows平台rac迁移到linux平台rac的,由于两个平台没有互相匹配的补丁号,当时在安装linux的rac时,找了一个与windows上版本(patch bundle 31)相近的11.2.0.3.11来打补丁,使用物理dg做迁移,在迁移完成后没有执行upgrade的sql。

mos上说的原因:This issue is caused by a mismatch between the DBMS_STATS package and the binary executable.包与实际的二进制可执行文件不匹配,联想到当时迁移后没有执行upgrade,基本确认就是这个问题。
解决方法是重建dbms_stats包。
mos原文如下:
Gathering Statistics with DBMS_STATS Fails Raising 'ORA-20003: Specified Bug Number (%s) Does Not Exist' Where the Bug number Reported is 5099019 or 16470836 (Doc ID 1180514.1)

To Bottom

In this Document

Symptoms
Changes
Cause
Solution
References

Applies to:

Oracle Database - Enterprise Edition - Version 10.2.0.1 and later
Information in this document applies to any platform.

Symptoms

Executing DBMS_STATS fails with either of the following error messages:

SQL> set serveroutput on
SQL> exec dbms_stats.gather_table_stats(ownname=> 'SCHEMA',tabname=>
'TABLE_NAME', degree=>4 , cascade=>TRUE, estimate_percent=>25);BEGIN dbms_stats.gather_table_stats(ownname=> 'SCHEMA',tabname=> 'TABLE_NAME', degree=>4 , cascade=>TRUE, estimate_percent=>25); END;
*
ERROR at line 1:
ORA-20003: Specified bug number (5099019) does not exist
ORA-06512: at "SYS.DBMS_STATS", line 13474
ORA-06512: at "SYS.DBMS_STATS", line 13494
ORA-06512: at line 1

or

SQL error -20003 at location stats_tab_collect-21, SQL statement:
'BEGIN DBMS_STATS.GATHER_TABLE_STATS (OWNNAME => '"SCHEM"', TABNAME => '"TABLE_NAME"', ESTIMATE_PERCENT => NULL, METHOD_OPT => 'FOR ALL COLUMNS SIZE 1', DEGREE => NULL, CASCADE => TRUE, NO_INVALIDATE => FALSE); END;'
ORA-20003: Specified bug number (16470836) does not exist
ORA-06512: at "SYS.DBMS_STATS", line 24301
ORA-06512: at "SYS.DBMS_STATS", line 24352
ORA-06512: at line 1

Changes

An upgrade may have occurred, but this is not necessary to trigger this issue.

Cause

This issue is caused by a mismatch between the DBMS_STATS package and the binary executable. If one has been updated and the other has not then errors will occur. The cause of the issue is one of:

1) Problems with validity of the dictionary objects upon which DBMS_STATS package depends.  This is documented in the following bug:

Bug 8643809 ORA-20003: SPECIFIED BUG NUMBER (5099019) DOES NOT EXIST

Post installation steps should install / validate these packages. If this was not done then this can cause the issue.

2) Relinking of the binary executable files has not occurred following a patch application. This can occur when multiple patches are applies and the -no_relink flag has been used on the opatch command to avoid linking every time. If this option is used on all the applications then necessary relinking will not occur. See opatch help:

opatch apply -help-no_relinkThe nolink option does not perform any make operations.This option can be used during multiple patchapplications and perform the linking step only once.OPatch does not keep track of the make operations itdid not perform. It is the job of the OPatch users tomake sure the execute OPatch without this option atthe end, so that compilation happens once

Solution

The following have resolved the issue:

1) Recreate DBMS_STATS package by running the following scripts:

@?/rdbms/admin/dbmsstat.sql
  @?/rdbms/admin/prvtstas.plb
  @?/rdbms/admin/prvtstat.plb

We recommend running these scripts during maintenance window while database in restricted mode to avoid problems that can be caused when other sessions access the same objects.

2) If a patch or an upgrade has been performed, relink the binaries after applying the patch. See the following for details:

Document 1467060.1 Relinking Oracle Home FAQ ( Frequently Asked Questions)

References

NOTE:868717.1 - EMCA Fails with: ORA-20003: Specified Bug Number (5099019) Does Not Exist
NOTE:1467060.1 - Relinking Oracle Home FAQ ( Frequently Asked Questions)
NOTE:16470836.8 - Bug 16470836 - High DML rate against MON_MODS$ related to DBMS_STATS

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/29822273/viewspace-2139924/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/29822273/viewspace-2139924/

执行DBMS_SQLTUNE优化sql或dbms_stats收集统计信息报错:ORA-20003相关推荐

  1. ORA-03001,GATHER_TABLE_STATS数据库自动收集统计信息报错

    1.根据Alert报错信息,查询Trace日志 /oracle/app/oracle/admin/fgsquery/bdump/fgsquery_j001_11111.trc Oracle Datab ...

  2. oracle并行收集统计信息慢,Oracle 学习之性能优化(四)收集统计信息

    emp表有如下数据.SQL> select ename,deptno from emp; ENAME   DEPTNO ------------------------------ ------ ...

  3. oracle tabe unlock_Oracle 学习之性能优化(四)收集统计信息

    emp表有如下数据.SQL> select ename,deptno from emp; ENAME   DEPTNO ------------------------------ ------ ...

  4. oracle数据泵导入分区表统计信息报错(一)

    今天在进行数据泵导入操作时,发现一个bug. 数据库版本Oracle 10203 for Solaris RAC,执行导入在处理表的统计信息时报错,错误信息为:ORA-39083和ORA-917. 经 ...

  5. oracle导入表 忽略报错,oracle数据泵导入分区表统计信息报错(一)

    今天在进行数据泵导入操作时,发现一个bug. 数据库版本Oracle 10203 for Solaris RAC,执行导入在处理表的统计信息时报错,错误信息为:ORA-39083和ORA-917. 经 ...

  6. oracle数据泵导入分区表,数据泵导入分区表统计信息报错(七)

    其实问题的引出是由于出现第一篇文章中描述的问题,不过随着问题的深入研究,挖掘出了一些隐藏的很深的问题,不过问题的研究也慢慢脱离了原本的问题. 在解决了表统计信息锁定的问题后,在回过头看看导致第一篇文章 ...

  7. 执行redis命令redis-trib.rb查看集群信息报错cannot load such file -- redis (LoadError)

    问题描述: 在执行redis-trib.rb命令查看集群状态的时候,报错: [aiprd@hadoop1 ~]$ redis-trib.rb check 192.168.30.10:7000 Trac ...

  8. oracle 收集统计信息会锁表吗,统计信息锁住导致收集统计信息失败引起sql执行异常...

    这个是老生产谈的事情,统计信息不准确导致sql执行异常,此次记录的主要是表的统计信息被锁住导致无法正常收集统计信息导致sql执行异常: 收集表的统计信息: SQL> exec DBMS_STAT ...

  9. oracle tabe unlock_Oracle数据库之统计信息锁住导致收集统计信息失败引起sql执行异常...

    本文主要向大家介绍了Oracle数据库之统计信息锁住导致收集统计信息失败引起sql执行异常,通过具体的内容向大家展现,希望对大家学习Oracle数据库有所帮助. 这个是老生产谈的事情,统计信息不准确导 ...

  10. oracle收集统计信息sql,Oracle自动统计信息的收集原理及实验

    从Oracle Database 10g开始,Oracle在建库后就默认创建了一个名为GATHER_STATS_JOB的定时任务,用于自动收集CBO的统计信息.这个自动任务默认情况下在工作日晚上10: ...

最新文章

  1. OKR的实施案例:OKR不需要很复杂
  2. 修改 Oracle 数据库 sequence(序列) 的 increment (步长)
  3. Ruby版本管理(RVM)
  4. linux下kill指令默认信号,Linux基础命令之kill命令
  5. 在Ubuntu 16.04.3 LTS 和 Windows 下安装 Go 环境
  6. 开源分布式搜索平台ELK+Redis+Syslog-ng实现日志实时搜索
  7. 使用CSS3伪类元素(::before|::after)对文字进行美化
  8. udp组播的应用场景
  9. python的ols_【量化工具】OLS在python中的四种实现方式
  10. 支付业务与技术架构学习总结(4)——对账相关业务知识及对账系统总结
  11. [Java] 蓝桥杯ALGO-98 算法训练 数位分离
  12. Delphi中TEdgeBrowser控件初探
  13. C语言使用文件指针时遇到的位置问题
  14. NTC热敏电阻的时间常数
  15. win10一直正在检查更新_受够了WIN10自动更新?阿虚教你一键禁止!
  16. 如何让小红书笔记下沉
  17. Executors-四种创建线程的手段
  18. windows tcpdump
  19. PHP strtotime()函数
  20. linux申请信号量,linux 信号量

热门文章

  1. 二级下拉菜单缓慢渐变
  2. TML5期末大作业:咖啡网站设计——咖啡网站pc端带轮播js (5页) 学生酒水网页作业, 生鲜水果网页作业成品, 零食小吃网页作 美食网页业模板
  3. Bluecoat:搭建未来知识产权管理构架
  4. [其他][转载]ACM知识点分类
  5. u3d计算向量间夹角
  6. php rrd getcreator,Cacti ERROR: opening '*.rrd': No such file or directory 解决方法
  7. Mirai僵尸网络介绍以及源码
  8. 云南农职《JavaScript交互式网页设计》 综合机试试卷④——蔚蓝网导航栏
  9. SAS用proc means和proc univariate求数据的样本均值、中位数、四分位数、样本方差、极差、变异系数、二阶、三阶和四阶中心矩、偏度、峰度、标准差和对数据进行正态性检验
  10. Pygame实战:这种“欢乐打地鼠”小游戏让几亿人“上瘾“