ORA-20000: Insufficient privileges to Analyze an object in Schema during Gather DBMS_STATS

Hi,

Sometimes You can get ”  ORA-20000: Insufficient privileges to Analyze an object in Schema  ” error during Gather DBMS_STATS Database, Schema, Table and Dictionary Stats.

 

ORA-20000: Insufficient privileges

Details of error are as follows.

ORA-20000: Insufficient privileges to analyze an object in Schema

ORA-06512: at "SYS.DBMS_STATS", line 13578

ORA-06512: at "SYS.DBMS_STATS", line 13937

ORA-06512: at "SYS.DBMS_STATS", line 14015

ORA-06512: at "SYS.DBMS_STATS", line 13974

ORA-06512: at line 1

 

 

ORA-20000: Insufficient privileges to Analyze an object in Schema

When you start the gather stats job without sys user ( sysdba priviliges ), you can get this error.

To solve this error, you should grant ANALYZE ANY DICTIONARY,ANALYZE ANY priviliged to the the related user as follows.

 

grant ANALYZE ANY DICTIONARY to MSDBA;

grant ANALYZE ANY to MSDBA;

Grant SELECT ANY TABLE to MSDBA;

Gather DBMS_STATS

You can gather fixed object stats as follows.
BEGIN
DBMS_STATS.GATHER_FIXED_OBJECTS_STATS;
END;
/

 

You can gather dictionary stats as follows.

BEGIN
DBMS_STATS.gather_dictionary_stats;
END;
/

 

You can gather any schema stats as follows.

BEGIN
DBMS_STATS.gather_schema_stats('MSDBA',estimate_percent => dbms_stats.auto_sample_size, degree=>96);
END;
/

 

You can gather any table stats as follows.

BEGIN
DBMS_STATS.gather_table_stats(ownname='MSDBA',tabname='TEST_TABLE', estimate_percent=> dbms_stats.auto_sample_size, degree=>8 );
END;
/

Do you want to learn more details about Database Stats , Schema Stats & Dictionary and Fixed Object Statistics, then read the following post.

 

Do you want to learn more details about RMAN, then read the following articles.

RMAN Tutorial | Backup, Restore and Recovery Tutorials For Beginner Oracle DBA

 

About Mehmet Salih Deveci

I am Founder of SysDBASoft IT and IT Tutorial and Certified Expert about Oracle & SQL Server database, Goldengate, Exadata Machine, Oracle Database Appliance administrator with 10+years experience.I have OCA, OCP, OCE RAC Expert Certificates I have worked 100+ Banking, Insurance, Finance, Telco and etc. clients as a Consultant, Insource or Outsource.I have done 200+ Operations in this clients such as Exadata Installation & PoC & Migration & Upgrade, Oracle & SQL Server Database Upgrade, Oracle RAC Installation, SQL Server AlwaysOn Installation, Database Migration, Disaster Recovery, Backup Restore, Performance Tuning, Periodic Healthchecks.I have done 2000+ Table replication with Goldengate or SQL Server Replication tool for DWH Databases in many clients.If you need Oracle DBA, SQL Server DBA, APPS DBA,  Exadata, Goldengate, EBS Consultancy and Training you can send my email adress [email protected].-                                                                                                                                                                                                                                                 -Oracle DBA, SQL Server DBA, APPS DBA,  Exadata, Goldengate, EBS ve linux Danışmanlık ve Eğitim için  [email protected] a mail atabilirsiniz.

4 comments

  1. I used to be recommended this website via my cousin. I am not sure whether this submit is written via him as nobody else
    know such designated approximately my trouble. You’re amazing!
    Thanks!

  2. Thank you for sharing superb informations. Your web-site is so cool

    Interior designers in hyderabad

  3. Lucas Colantuono

    Hello! I was facing an oracle error (ORA-20000: Insufficient privileges to Analyze an object in Schema), I found the solution in your blog. In one of the steps you recommend taking the statistics of the fixed views, why? how do these views affect tables that do not correspond to the oracle catalog? Thank you very much

Leave a Reply

Your email address will not be published. Required fields are marked *