zoukankan      html  css  js  c++  java
  • ORA-14450

    ORA-14450 attempt to access a transactional temp table already in use

    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.

    一般情况下,ORA-14450在自治事务中出现的多一些,大家在使用自治事务时一定要小心

    SQL> create global temporary table temp_toms
    2 (
    3 str varchar2(64)
    4 ) on commit delete rows;

    表已创建.

    SQL>

    SQL> select * from temp_toms;

    未选定行

    SQL> insert into temp_toms values('1234');

    已创建 1 行。

    SQL> select * from temp_toms;

    STR
    --------------------------------
    1234

    SQL> 
    SQL> declare
    2 pragma autonomous_transaction;
    3 begin
    4 insert into temp_toms values('other transaction use temp_toms test');
    5 commit;
    6 end;
    7 /
    declare
    *
    第 1 行出现错误:
    ORA-14450: 试图访问已经在使用的事务处理临时表
    ORA-06512: 在 line 4


    SQL> select * from temp_toms;

    STR
    --------------------------------
    1234

    SQL>

    另外一种情况下,也能出现ORA-14450的错误,测试如下

    SQL> select sid from v$mystat where rownum=1;

    SID
    ----------
    104
    SQL>

    SQL> desc temp_toms
    名称 是否为空? 类型
    ----------------------------------------- -------- -----------------
    STR VARCHAR2(32)

    SQL> insert into temp_toms values('modify structur test');

    已创建 1 行。

    SQL> 
    SQL> select * from temp_toms;

    STR
    --------------------------------
    modify structur test

    SQL>


    此时,在SID=104的session中不做commit/rollback,打开另外一个session,尝试修改临时表结构,
    看看会出现什么现象:

    C:Documents and Settingsunix>sqlplus study/study

    SQL*Plus: Release 10.2.0.1.0 - Production on 星期六 5月 6 12:26:54 2006

    Copyright (c) 1982, 2005, Oracle. All rights reserved.


    连接到:
    Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
    With the Partitioning, OLAP and Data Mining options

    SQL> select sid from v$mystat where rownum=1;

    SID
    ----------
    90

    SQL>
    SQL> alter table temp_toms add name varchar2(32);
    alter table temp_toms add name varchar2(32)
    *
    第 1 行出现错误:
    ORA-14450: 试图访问已经在使用的事务处理临时表

  • 相关阅读:
    (4)事件处理——(1)事件处理(Handling Events)
    S/4HANA服务订单Service Order的批量创建
    如何给SAP C4C的产品主数据division配置出新的下拉选项
    为什么S/4HANA的生产订单创建后会自动release
    为什么S/4HANA的销售订单创建会触发生产订单的创建
    SAP云平台对Kubernetes的支持
    什么是SAP GUI的client
    SAPGUI系统登录页面配置的SAProuter有什么用
    SAP R/3系统的R和3分别代表什么含义,负载均衡的实现原理
    一些通过SAP ABAP代码审查得出的ABAP编程最佳实践
  • 原文地址:https://www.cnblogs.com/HansonYao/p/4310252.html
Copyright © 2011-2022 走看看