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
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!
Thank you for sharing superb informations. Your web-site is so cool
Interior designers in hyderabad
thanks for your nice comments.
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