I recently had to face such a problem. For those who give up, the answer is below 🙂
exec dbms_Stats.gather_schema_stats(‘TESTSCHEMA’);
ERROR at line 1:
ORA-20000: Schema ” TESTSCHEMA” does not exist or insufficient privileges
ORA-06512: at “SYS.DBMS_STATS”, line 38330
ORA-06512: at “SYS.DBMS_STATS”, line 38289
ORA-06512: at “SYS.DBMS_STATS”, line 8593
ORA-06512: at “SYS.DBMS_STATS”, line 38172
ORA-06512: at “SYS.DBMS_STATS”, line 38317
ORA-06512: at line 1
select dbms_stats.get_prefs(‘concurrent’) from dual;
exec dbms_stats.set_global_prefs(‘CONCURRENT’,’FALSE’);
SQL> exec dbms_Stats.gather_schema_stats(‘TESTSCHEMA’);
PL/SQL procedure successfully completed.
Tags: