To lock statistics for a tables:
exec dbms_stats.lock_table_stats('<schema_name>', '<tablename>');
Ex:
exec dbms_stats.lock_table_stats('scott', 'test');
when stats is locked the value of stattype_locked is ALL in dba_tab_statistics;
select owner, table_name, stattype_locked from dba_tab_statistics where stattype_locked is not null;
To unlock table stats:
exec dbms_stats.unlock_table_stats('table_owner','table_name');
ex:
exec dbms_stats.unlock_table_stats('scott', 'test')
To lock statistics for a schema:
exec dbms_stats.lock_schema_stats('schema_owner');
exec dbms_stats.unlock_schema_stats('schema_owner');
No comments:
Post a Comment