Way to success...

--"Running Away From Any PROBLEM Only Increases The DISTANCE From The SOLUTION"--.....--"Your Thoughts Create Your FUTURE"--.....--"EXCELLENCE is not ACT but a HABIT"--.....--"EXPECT nothing and APPRECIATE everything"--.....

Wednesday, November 2, 2016

How to Unlock the stats for given tables

Identify the tables whose stats are locked by using below query:

Unlock the stats for given tables:

select owner, table_name, stattype_locked
from dba_tab_statistics
where stattype_locked is not null
and owner = 'APPLSYS' -- Schema Name


Unlock stats using below script:

SQL> exec dbms_stats.unlock_table_stats('owner', 'table_name');

For Example:

SQL> sho user
USER is "SYS"
SQL>
SQL> exec dbms_stats.unlock_table_stats('APPLSYS','AQ$_WF_CONTROL_P');

PL/SQL procedure successfully completed.

No comments:

Post a Comment