ORA14450: 试图访问已经在使用的事务处理临时表

 

ORA-00604: 递归 SQL 层 1 出现错误
ORA-14450: 试图访问已经在使用的事务处理临时表

首先要查一下错误信息, 可以从手册中查:

Cause: An attempt was made to access a transactional temporary table that has been already populated by a concurrent transaction of the same session.
Action: Do not attempt to access the temporary table until the concurrent transaction has committed or aborted.

这是由临时表导致的
--ON COMMIT DELETE ROWS 说明临时表是事务指定,每次提交后ORACLE将截断表(删除全部行)
--ON COMMIT PRESERVE ROWS 说明临时表是会话指定,当中断会话时ORACLE将截断表。

举个例子
开一Session(不要关闭)
create global temporary table tmp_test (col1 varchar2(200))
on commit preserve rows;

insert tmp_test values('YYYY');
commit;

再另开一Session
alter table tmp_test add col2 varchar2(200);

这时就会报
ORA-14450: attempt to access a transactional temp table already in use

在做数据库升级时要确定没有人在使用这个临时表,设计时也得考虑,三层结构时可以停服务中断访问。

解决方法:
关闭第一个会话,或者更改表的类型
原文地址:https://www.cnblogs.com/weaver1/p/2494022.html