ORA-20000: Unable to analyze INDEX “TEST1″.”FN_ORDER_DATE”, insufficient privileges or does not exist

ORA-20000: Unable to analyze INDEX “TEST1″.”FN_ORDER_DATE”, insufficient privileges or does not exist

Error:

User from which you try to gather stats doesnot have the necessary privilege!

SQL> !oerr ora 20000
20000, 00000, "%s"
// *Cause:  The stored procedure 'raise_application_error'
//          was called which causes this error to be generated.
// *Action: Correct the problem as described in the error message or contact
//          the application administrator or DBA for more information.

SQL> exec dbms_stats.gather_index_stats('TEST1','fn_order_date');
BEGIN dbms_stats.gather_index_stats('TEST1','fn_order_date'); END;

*
ERROR at line 1:
ORA-20000: Unable to analyze INDEX "TEST1"."FN_ORDER_DATE", insufficient
privileges or does not exist
ORA-06512: at "SYS.DBMS_STATS", line 30110
ORA-06512: at "SYS.DBMS_STATS", line 30024
ORA-06512: at "SYS.DBMS_STATS", line 29963
ORA-06512: at "SYS.DBMS_STATS", line 30097
ORA-06512: at line 1

Solution:

Grant execute privilege on dbms stats !

SQL> grant execute on dbms_stats to test1;

Grant succeeded.

SQL> exec dbms_stats.gather_index_stats('TEST1','fn_order_date');

PL/SQL procedure successfully completed.

Leave a Reply

%d bloggers like this: