ORA-20000: Insufficient Privileges On Dbms_stats (Doc ID 822331.1)

Last updated on JUNE 14, 2017

Applies to:

Oracle Database - Enterprise Edition - Version 10.2.0.1 and later
Information in this document applies to any platform.
***Checked for relevance on 24-Sep-2014***

This problem can occur on any platform.

Symptoms

Automated Gather Stats Job fails with errors :

ORA-12012: error on auto execute of job 8951
ORA-20000: ORA-20000: Insufficient privileges
ORA-06512: at "SYS.DBMS_STATS", line 2175


Related queries to role-privileges returned :

SQL> conn / as sysdba

    select * from ( select r.privilege
    from user_role_privs u,role_sys_privs r
    where u.granted_role=r.role
    union all
    select privilege
    from user_sys_privs
    )
    where privilege = 'ANALYZE ANY'
      and rownum < 2;
    
    PRIVILEGE
    ----------------------------------------
    ANALYZE ANY
    
    1 row selected.
    
    SQL> select r.role, r.privilege
         from user_role_privs u,role_sys_privs r
         where u.granted_role=r.role
         and r.privilege='ANALYZE ANY'
         /
    
    no rows selected
    
    SQL> select privilege
         from user_sys_privs
         where privilege='ANALYZE ANY'
         /
    
    PRIVILEGE
    ----------------------------------------
    ANALYZE ANY
    
    1 row selected.

Changes

 

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