【ORA】ORA-38029 & ORA-20005

从10g导出了一致表到本地的11g环境中做测试。导入后习惯的去收集一下统计信息。遇到了ORA-20005ORA-38029错误。

/home/oracle$oerr ora 38029
38029, 00000, "object statistics are locked"
// *Cause: An attept was made to modify optimizer statistics of the object.
// *Action: Unlock statistics with the DBMS_STATS.UNLOCK_TABLE_STATS procedure
// on base table(s). Retry the operation if it is okay to update statistics.


Cause
Possible Cause #1: DBMS_STATS.LOCK_[SCHEMA|TABLE]_STATS has been used to lock statistics on the table.

Possible Cause #2: Using import (imp) or data pump import (impdp) to import a table without data results in the table's statistics being locked in 10gR2.

Possible Cause #3: If the table is a queue table then the statistics are intended to be empty and locked so that dynamic sampling will be used due to the table's volatility. During an upgrade to 10gR2 statistics on queue tables are deleted and then locked. In 10gR2 when a queue table is created statistics are locked while still empty.

Oracle Database Readme
10g Release 2 (10.2)
Part Number B14233-04
39.5 Original Export/Import
After an IMPORT is finished for which ROWS=N, the statistics for all tables imported will be locked.

Solution
- Unlock the table statistics after the import:
execute DBMS_STATS.UNLOCK_TABLE_STATS('','

我遇到的可能是ROWS=N这种情况,在开始导入到时候确实是加了ROWS=N这个参数。

示例:
SQL> EXEC DBMS_STATS.gather_table_stats('REPORT','SWFLOG');
begin DBMS_STATS.gather_table_stats('REPORT','SWFLOG'); end;

ORA-20005: object statistics are locked (stattype = ALL)
ORA-06512: 在 "SYS.DBMS_STATS", line 20337
ORA-06512: 在 "SYS.DBMS_STATS", line 20360
ORA-06512: 在 line 1

SQL> ANALYZE TABLE SWFLOG COMPUTE STATISTICS;

ANALYZE TABLE SWFLOG COMPUTE STATISTICS
ORA-38029: 对象统计信息已锁定


解决方法:

SQL> execute DBMS_STATS.UNLOCK_TABLE_STATS('REPORT','SWFLOG');
PL/SQL procedure successfully completed

SQL> EXEC DBMS_STATS.gather_table_stats('REPORT','SWFLOG');
PL/SQL procedure successfully completed

SQL> ANALYZE TABLE SWFLOG COMPUTE STATISTICS;
Table analyzed

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

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/26892340/viewspace-722175/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值