新的Oracle 11g資料是由datapump移轉過來的,在執行Gather Schema Statistics時發生錯誤:
ORA-20005: object statistics are locked (stattype = ALL)
解決方案:
This problem can occur on any platform.
DataPump Import without data (CONTENT=METADATA_ONLY) locks statistics.
Executing the DBMS_STATS.GATHER_TABLE_STATS to collect the statistics on the table imported, it fails with:
The statistics are locked during a DataPump Import if export or import were performed with CONTENT = METADATA_ONLY.
This is because automatic statistics gathering is enabled by default in 10g. Therefore, the imported statistics, if not locked, are lost the next time the auto-stats job runs
To avoid the ORA-20005:
- Unlock the table statistics after the import:
execute DBMS_STATS.UNLOCK_TABLE_STATS('','');
ORA-20005: object statistics are locked (stattype = ALL)
解決方案:
This problem can occur on any platform.
DataPump Import without data (CONTENT=METADATA_ONLY) locks statistics.
Executing the DBMS_STATS.GATHER_TABLE_STATS to collect the statistics on the table imported, it fails with:
The statistics are locked during a DataPump Import if export or import were performed with CONTENT = METADATA_ONLY.
This is because automatic statistics gathering is enabled by default in 10g. Therefore, the imported statistics, if not locked, are lost the next time the auto-stats job runs
To avoid the ORA-20005:
- Unlock the table statistics after the import:
execute DBMS_STATS.UNLOCK_TABLE_STATS('
留言列表