DBMS_STATS.GATHER_SCHEMA_STATS() Analyzes Only A Few Objects and does not Raise ORA-20005 Errors for Locked Statistics (Doc ID 732082.1)

Last updated on NOVEMBER 17, 2016

Applies to:

Oracle Database - Standard Edition - Version 10.1.0.2 to 10.2.0.4 [Release 10.1 to 10.2]
Oracle Database - Enterprise Edition - Version 10.1.0.2 to 10.2.0.4 [Release 10.1 to 10.2]
Oracle Database - Personal Edition - Version 10.1.0.2 to 10.2.0.4 [Release 10.1 to 10.2]
Information in this document applies to any platform.

Symptoms

You run a dbms_stats.gather_schema_stats() procedure using a typical syntax like following:

dbms_stats.gather_schema_stat(ownname=>'SCHEMA_NAME', estimate_percent=>30, cascade=>TRUE);

The intention is to collect statistics for all tables in this schema.  When the procedure completed without errors , you check  the result and find that only some but not all tables in the schema  'SCHEMA_NAME'  have been analyzed:

SQL> select table_name, last_analyzed from dba_tables where owner='SCHEMA_NAME';

TABLE_NAME          LAST_ANALYZED
------------------           -----------------------
A_1                                06-AUG-08
A_2                                06-AUG-08
…                                   …
B_1                                30-JUL-08
B_2                                30-JUL-08
…                                   …
C_1                                30-JUL-08
C_2                                30-JUL-08
C_3                                30-JUL-08

 

Cause

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms