exec dbms_stats.gather_table_stats('TEST');
ORA-20005: object statistics are locked (stattype = ALL)
ORA-06512: 在 "SYS.DBMS_STATS", line 13056
ORA-06512: 在 "SYS.DBMS_STATS", line 13076
ORA-06512: 在 line 2
这个提示告诉我们,这个表的统计计息被锁定,不允许更新,这是Oracle 10g的一个新特性,允许我们锁定某些对象的统计信息
select * from USER_TAB_STATISTICS;--stattype_locked 为all
exec dbms_stats.unlock_schema_stats(ownname => 'test');===执行这个就正常了===
再次执行exec dbms_stats.gather_table_stats('TEST');--正常
原因是因为使用impdp 只导入metadata_only 或(expdp的时候使用了contend=metadata_only)时
没有使用 use exclude=(table_statistics,index_statistics)引起的
ORA-20005: object statistics are locked (stattype = ALL)
ORA-06512: 在 "SYS.DBMS_STATS", line 13056
ORA-06512: 在 "SYS.DBMS_STATS", line 13076
ORA-06512: 在 line 2
这个提示告诉我们,这个表的统计计息被锁定,不允许更新,这是Oracle 10g的一个新特性,允许我们锁定某些对象的统计信息
select * from USER_TAB_STATISTICS;--stattype_locked 为all
exec dbms_stats.unlock_schema_stats(ownname => 'test');===执行这个就正常了===
再次执行exec dbms_stats.gather_table_stats('TEST');--正常
原因是因为使用impdp 只导入metadata_only 或(expdp的时候使用了contend=metadata_only)时
没有使用 use exclude=(table_statistics,index_statistics)引起的
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/28258625/viewspace-1440842/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/28258625/viewspace-1440842/