ORA-20000: Insufficient privileges to Analyze an object in Schema during Gather DBMS_STATS Database, Schema, Table and Dictionary 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.

 

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

 

 

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

 

 456 views last month,  17 views today

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 mehmetsalih.deveci@outlook.com. -                                                                                                                                                                                                                                                 - Oracle DBA, SQL Server DBA, APPS DBA,  Exadata, Goldengate, EBS ve linux Danışmanlık ve Eğitim için  mehmetsalih.deveci@outlook.com a mail atabilirsiniz.

Check Also

blank

ORA-01438: value larger than specified precision allowed for this column

Hi, I got ” ORA-01438: value larger than specified precision allowed for this column” error …

Leave a Reply