oracle 存储过程执行报错ORA-12828
2017-11-15 16:32
645 查看
操作系统:windows server 2008R2
数据库版本:oracle 11.2.0.3 单实例
今天,一开发同事找来,说他的存储过程在龙岩地市执行报错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, "Can't 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相关
Oracle Database - Enterprise Edition - Version 11.2.0.1.0 to 11.2.0.4 [Release 11.2]
Information in this document applies to any platform.
The 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 doesn't work while parallel index rebuild remotely through a procedure. In detail:
As the Bug 14684769 states, this works as expected and it is not supported to parallelize the index by using the dblink.
The 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.
BUG:14684769 - REMOTE PARALLEL INDEX REBUILD RUNS SERIAL
BUG:2166879 - ORA-12828 WHEN INDEX CREATED IN PARALLEL MODE THROUGH REMOTE PROCEDURE
查看开发同事提供的代码并没有使用到dblink,根据oracle官方(ID
1535660.1)提示,ORA12828与索引重建有关,
让开发同事尝试去掉update
global indexes子句重新执行,可成功执行。其实更新表数据同步更新索引,是防止分区表分区索引失效。
于是,建议他将索引重建子句去除,另外在存储过程中添加专门的索引重建语句(经他测试,可以执行)。
另外,根据他提供的信息该代码并不是在所有地市都报错,只有目前的龙岩windows server 2008R2 oracle 11.2.0.3单实例下。
数据库版本:oracle 11.2.0.3 单实例
今天,一开发同事找来,说他的存储过程在龙岩地市执行报错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, "Can't 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相关
APPLIES TO:
Oracle Database - Enterprise Edition - Version 11.2.0.1.0 to 11.2.0.4 [Release 11.2]Information in this document applies to any platform.
SYMPTOMS
The 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 doesn't work while parallel index rebuild remotely through a procedure. In detail:
CAUSE
As the Bug 14684769 states, this works as expected and it is not supported to parallelize the index by using the dblink.
SOLUTION
The 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.
REFERENCES
BUG:14684769 - REMOTE PARALLEL INDEX REBUILD RUNS SERIALBUG:2166879 - ORA-12828 WHEN INDEX CREATED IN PARALLEL MODE THROUGH REMOTE PROCEDURE
查看开发同事提供的代码并没有使用到dblink,根据oracle官方(ID
1535660.1)提示,ORA12828与索引重建有关,
让开发同事尝试去掉update
global indexes子句重新执行,可成功执行。其实更新表数据同步更新索引,是防止分区表分区索引失效。
于是,建议他将索引重建子句去除,另外在存储过程中添加专门的索引重建语句(经他测试,可以执行)。
另外,根据他提供的信息该代码并不是在所有地市都报错,只有目前的龙岩windows server 2008R2 oracle 11.2.0.3单实例下。
相关文章推荐
- 执行oracle中的job报错:ORA-12011:无法执行作业1存储过程执行DDL语句提示ORA-01031错误:权限不足
- Oracle.DataAccess.Client.OracleException ORA-00600: 内部错误代码,通过C#执行上面存储过程报错,而通过PLSQL执行不报错。谁知道原因。
- Oracle 11g保证存储过程同时只能被一个线程执行
- oracle环境下在dos中使用编译sql脚本执行存储过程的方法
- ado.net执行oracle 存储过程
- Oracle 在函数或存储过程中执行一条插入语句并返回主键ID值
- C#+Oracle开发中执行存储过程问题
- oracle 存储过程执行动态sql返回游标
- 00011.Oracle编译存储过程及执行
- oracle定义job执行存储过程方式
- Dapper完美兼容Oracle,执行存储过程,并返回结果集。
- C#+Oracle开发中执行存储过程问题
- 赋予oracle执行存储过程权限和创建表权限
- Dapper完美兼容Oracle,执行存储过程,并返回结果集。
- oracle job 定时执行 存储过程
- Oracle中执行存储过程call和exec区别
- oracle 简单存储过程及在PL/Sql中执行
- 在命令窗口下编写Oracle存储过程并执行的简单例子
- Oracle 执行带有out参数的存储过程(不积跬步,无以至千里)
- Oracle存储过程中执行DDL操作