Thursday, April 12, 2012

How to find table where statistics are locked

You can use the below query

select owner, table_name, stattype_locked
from dba_tab_statistics
where stattype_locked is not null;


Now once we find out the objects,we can use below queries to unlock them
exec dbms_stats.unlock_schema_stats('schema_owner');
exec dbms_stats.unlock_table_stats('table_owner','table_name');

-->

Labels: