ORA-20000 'Insufficient Privileges' While Executing DBMS_STATS.GATHER_SCHEMA_STATS (Doc ID 309834.1)

Last updated on JULY 03, 2017

Applies to:

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

Symptoms

ORA-20000 while executing "dbms_stats.gather_schema_stats" is dumped while trying to generate statistics.

Example of the error:

Connect as user ABC.

User ABC has DBA role granted.

DBA role includes "analyze any" system privilege.

Also granted "analyze any" privilege explicitly to user ABC.

 

SQL> exec dbms_stats.gather_schema_stats('SCOTT',degree=>4,cascade=>TRUE,estimate_percent=>35);
BEGIN dbms_stats.gather_schema_stats('SCOTT',degree=>4,cascade=>TRUE,estimate_pe
rcent=>35); END;
ERROR at line 1:
ORA-20000: Insufficient privileges to analyze an object in Schema
ORA-06512: at "SYS.DBMS_STATS", line 10583
ORA-06512: at "SYS.DBMS_STATS", line 10751
ORA-06512: at "SYS.DBMS_STATS", line 10805
ORA-06512: at "SYS.DBMS_STATS", line 10782
ORA-06512: at line 1

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