zoukankan      html  css  js  c++  java
  • 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

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

    解决方法:
    关闭第一个会话,或者更改表的类型
  • 相关阅读:
    lintcode491 回文数
    lintcode514 栅栏染色
    lintcode433 岛屿的个数
    lintcode142 O(1)时间检测2的幂次
    lintcode166 链表倒数第n个节点
    lintcode539 移动零
    lintcode: Check Sum of Square Numbers
    lintcode: Missing String
    lintcode 二叉树的锯齿形层次遍历
    Mysql 游标的定义与使用方式
  • 原文地址:https://www.cnblogs.com/weaver1/p/2494022.html
Copyright © 2011-2022 走看看