ORA-20005的解决方法

本文探讨了在Oracle 10g中使用数据泵进行元数据导出和导入时,如何解决因默认启用自动统计信息收集而导致的统计信息锁定问题。提供了两种解决方案:解锁表统计信息或排除表统计信息的导入。

 

Applies to:

Oracle Server - Enterprise Edition - Version: 10.2.0.1 to 10.2.0.3

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:

ORA-20005: object statistics are locked (stattype = ALL)

This is an expected behavior. in 10.2.0

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('','

OR

- Do not import the table statistics (EXCLUDE=TABLE_STATISTICS impdp parameter)

运行下列SQL

SQL> select owner, table_name, stattype_locked from dba_tab_statistics where stattype_locked is not null;

OWNER TABLE_NAME STATT

------------------------------

APPLSYS WF_NOTIFICATION_OUT ALL

1 row selected.

SQL> exec dbms_stats.unlock_table_stats('APPLSYS','WF_NOTIFICATION_OUT');

PL/SQL procedure successfully completed.

SQL> select owner, table_name, stattype_locked from dba_tab_statistics where stattype_locked is not null;

no rows selected

问题解决。

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/35489/viewspace-620936/,如需转载,请注明出处,否则将追究法律责任。

user_pic_default.png
请登录后发表评论 登录
全部评论
<%=items[i].createtime%>

<%=items[i].content%>

<%if(items[i].items.items.length) { %>
<%for(var j=0;j
<%=items[i].items.items[j].createtime%> 回复

<%=items[i].items.items[j].username%>   回复   <%=items[i].items.items[j].tousername%><%=items[i].items.items[j].content%>

<%}%> <%if(items[i].items.total > 5) { %>
还有<%=items[i].items.total-5%>条评论 ) data-count=1 data-flag=true>点击查看
<%}%>
<%}%> <%}%>

转载于:http://blog.itpub.net/35489/viewspace-620936/

评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符  | 博主筛选后可见
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值