小程序三方平台开发: 解析小程序开发的未来趋势和机遇
212
2023-12-28
oracle存储过程执行报错ORA-12828该怎么办,相信很多没有经验的人对此束手无策,为此本文总结了问题出现的原因和解决方法,通过这篇文章希望你能解决这个问题。
今天,一开发同事找来,说他的存储过程在龙岩地市执行报错ORA-12828,说代码执行到如下代码块的时候报错退出:
EXECUTE IMMEDIATE ALTER TABLE FACT_COSTS TRUNCATE PARTITION P_FACT_COSTS_||PRM_MONTH|| update global indexes;
查看oracle联机文档对ORA-12828的解释:
[oracle@se31 ~]$ oerr ora 12828
12828, 00000, "Cant start parallel transaction at a remote site"
// *Cause: PDML transaction cannot be started because we are not in the
// coordinator site of the distributed transaction.
// *Action: Do not use PDML at remote sites.
[oracle@se31 ~]$查询oracle support知识库,有篇文档(ID 1535660.1)与ORA-12828相关
Information in this document applies to any platform.
SYMPTOMSThe remote parallel index rebuild runs serial even if enabling parallel replication propagation at the database link level. For example if a database link is created for a particular destination database, and enabling parallel propagation for a database link, then Oracle uses multiple parallel slave processes to replicate to the corresponding destination. But it doesnt work while parallel index rebuild remotely through a procedure. In detail:
CAUSEAs the Bug 14684769 states, this works as expected and it is not supported to parallelize the index by using the dblink.
SOLUTIONThe dblink is not supported to parallelize the rebuild index.
As per the fix for Bug 2166879, create index will not be compiled for parallel execution if it is being executed in a distributed txn.
查看开发同事提供的代码并没有使用到dblink,根据oracle官方(ID 1535660.1)提示,ORA12828与索引重建有关,
让开发同事尝试去掉update global indexes子句重新执行,可成功执行。其实更新表数据同步更新索引,是防止分区表分区索引失效。
于是,建议他将索引重建子句去除,另外在存储过程中添加专门的索引重建语句(经他测试,可以执行)。
另外,根据他提供的信息该代码并不是在所有地市都报错,只有目前的龙岩windows server 2008R2 oracle 11.2.0.3单实例下。
看完上述内容,你们掌握oracle存储过程执行报错ORA-12828该怎么办的方法了吗?如果还想学到更多技能或想了解更多相关内容,欢迎关注行业资讯频道,感谢各位的阅读!
版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。
发表评论
暂时没有评论,来抢沙发吧~