My Oracle Support Banner

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 OCTOBER 31, 2019

Applies to:

Oracle Database - Enterprise Edition - Version to [Release 10.1 to 10.2]
Oracle Database - Standard Edition - Version to [Release 10.1 to 10.2]
Oracle Database - Personal Edition - Version to [Release 10.1 to 10.2]
Oracle Database Cloud Schema Service - Version N/A and later
Oracle Database Exadata Cloud Machine - Version N/A and later
Information in this document applies to any platform.


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';

------------------           -----------------------
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



To view full details, sign in with your My Oracle Support account.

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

In this Document

My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.