Lock schema stats - need for clarify
Hi,
due problems while nightly collecting statistics in a specified schema I wanted to lock temporarily this schema with
exec dbms_stats.LOCK_SCHEMA_STATS('inspire');
I thought this will exclude that from nightly maintanance jobs. But locking the entire schema had seemingly no affect.
I tested it out in my testenv with Oracle 12c and 11g:
If you lock a schema your are still able to collect entire schema stats with:
SQL> exec dbms_stats.LOCK_SCHEMA_STATS('inspire'); PL/SQL-Prozedur erfolgreich abgeschlossen. SQL> exec dbms_stats.gather_SCHEMA_STATS('inspire'); PL/SQL-Prozedur erfolgreich abgeschlossen.
Only if you want to collect stats from on table from that locked schema you get the expected error: