oracle ORA-14450“尝试访问已在使用中的事务临时表”,没有自主事务

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/27111415/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-09 00:40:57  来源:igfitidea点击:

ORA-14450 "attempt to access a transactional temporary table alreadyin use" with no autonomous transactions

oracletransactions

提问by user3546978

i cannot provide specific code because the solution is classified. I'd just like to ask if, in some situation, it is possible to have the error ORA-14450 "attempt to access a transactional temporary table already in use" without having any autonomous transactions or DDL code.

我无法提供特定代码,因为该解决方案已分类。我只是想问一下,在某些情况下,是否有可能在没有任何自治事务或 DDL 代码的情况下出现错误 ORA-14450“尝试访问已在使用的事务临时表”。

This only happens once in a while. The application uses both database procedures and oracle forms.

这只是偶尔发生一次。该应用程序同时使用数据库过程和 oracle 形式。

Thanks in advance

提前致谢

回答by mmmmmpie

ORA-14450 means you have a blocking session on the temp table. Find the blocking session and kill it if need be.

ORA-14450 意味着您在临时表上有一个阻塞会话。找到阻塞会话并在需要时将其杀死。

SELECT * FROM v$lock
  WHERE id1 = (SELECT object_id FROM all_objects WHERE owner = <schema_name> 
               AND object_name =<glb temp table>) --find which sessions lock the temp table

SELECT * FROM v$session WHERE sid =<above query result> --find their's sid and serial

ALTER SYSTEM KILL SESSION '<sid>,<serial>';

Credit

信用

回答by Viktor

IF your GTT is created using on COMMIT PRESERVE ROWS clause then it will still not help if there is no locking. Once a user does a DML on this table and completes the transaction, the table is still in use. It won't show up in the v$lock if transaction is committed.

如果您的 GTT 是使用 on COMMIT PRESERVE ROWS 子句创建的,那么如果没有锁定,它仍然无济于事。一旦用户对该表执行 DML 并完成事务,该表仍在使用中。如果提交事务,它不会出现在 v$lock 中。