2013年2月28日 星期四

Gather Schema Statistics 遇到 ORA-20005: object statistics are locked (stattype = ALL) 的錯誤


Error message:
+---------------------------------------------------------------------------+
In GATHER_SCHEMA_STATS , schema_name= HR percent= 100 degree = 16 internal_flag= NOBACKUP
Error #1: ERROR: While GATHER_TABLE_STATS:
          object_name=HR.HR_ALL_ORGANIZATION_UNITS
          ***ORA-20005: object statistics are locked (stattype = ALL)***
+---------------------------------------------------------------------------+

Solution:
確認 log 出現的 table 使用以下SQL找的出來:

select owner,table_name
from dba_tab_statistics a
where a.STATTYPE_LOCKED = 'ALL'
and owner <> 'SYS';


執行:
exec dbms_stats.unlock_table_stats('HR', 'HR_ALL_ORGANIZATION_UNITS');

沒有留言:

張貼留言