执行DBMS_SQLTUNE优化sql或dbms_stats收集统计信息报错:ORA-20003
db:oracle 11.2.0.3.11 rac
執(zhí)行DBMS_SQLTUNE優(yōu)化sql或dbms_stats收集統(tǒng)計信息報錯:ORA-20003: Specified bug number (16470836) does not exist
這個錯誤很早之前就遇到了,當時查了mos,已經(jīng)大概找到原因。但是一直沒有停機窗口來維護。這次在執(zhí)行DBMS_SQLTUNE優(yōu)化sql時又遇上了,這里做一個簡單的記錄。
這套系統(tǒng)是從windows平臺rac遷移到linux平臺rac的,由于兩個平臺沒有互相匹配的補丁號,當時在安裝linux的rac時,找了一個與windows上版本(patch bundle 31)相近的11.2.0.3.11來打補丁,使用物理dg做遷移,在遷移完成后沒有執(zhí)行upgrade的sql。
mos上說的原因:This issue is caused by a mismatch between the DBMS_STATS package and the binary executable.包與實際的二進制可執(zhí)行文件不匹配,聯(lián)想到當時遷移后沒有執(zhí)行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 laterInformation 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 1or
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 1Changes
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 EXISTPost 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的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 密码学·常用网址
- 下一篇: 学习3D游戏建模有哪些好的书籍教材?0基