Wednesday, 27 December 2017

Unlock Table statistics


########THEN####
SQL> col stattype_locked for a30
SQL> select owner, table_name, stattype_locked from dba_tab_statistics where stattype_locked is not null and owner not in ('SYS','SYSTEM');

OWNER TABLE_NAME STATTYPE_LOCKED
------------------------------ ------------------------------ ------------------------------
SCOTT TIGER ALL


1 rows selected.


SQL> exec dbms_stats.unlock_table_stats('SCOTT', 'TIGER');

PL/SQL procedure successfully completed.



####NOW#####

SQL> select owner, table_name, stattype_locked from dba_tab_statistics where stattype_locked is not null and owner not in ('SYS','SYSTEM');

no rows selected

SQL>