ORA-14450: attempt to access a transactional temp table already in use
在ORACLE数据中修改会话级临时表时,有可能会遇到ORA-14550错误,那么为什么会话级全局临时表会报ORA-14450错误呢,如下所示,我们先从一个小小案例入手:
案例1:
SQL> CREATE GLOBAL TEMPORARY TABLE TEMP_TEST
2 (
3 NAME VARCHAR2(12)
4 ) ON COMMIT PRESERVE ROWS;
Table created.
SQL> INSERT INTO TEMP_TEST VALUES('kerry');
1 row created.
SQL> COMMIT;
Commit complete.
SQL> ALTER TABLE TEMP_TEST ADD SEX NUMBER(1) ;
ALTER TABLE TEMP_TEST ADD SEX NUMBER(1)
*
ERROR at line 1:
ORA-14450: attempt to access a transactional temp table already in use
如上所示,修改会话级临时表时遇到了ORA-14450错误,那么有哪些解决方法呢? 这时需要断开会话或执行TRUNCATE语句:
SQL> TRUNCATE TABLE TEMP_TEST;
Table truncated.
SQL> ALTER TABLE TEMP_TEST ADD SEX NUMBER(1) ;
Table altered.
SQL>
如下所示,我们模拟一个会话在操作临时表TEMP_TEST, 另外一个会话准备修改它,如下所示(实际场景可能更复杂,可能涉及多个会话而不是仅仅两个会话)
会话1:
SQL> SET SQLPROMPT "SQLSESSION 1 >"
SQLSESSION 1 >CREATE GLOBAL TEMPORARY TABLE TEMP_TEST
2 (
3 NAME VARCHAR2(12)
4 ) ON COMMIT PRESERVE ROWS;
Table created.
SQLSESSION 1 >INSERT INTO TEMP_TEST VALUES('kerry');
1 row created.
SQLSESSION 1 >COMMIT;
Commit complete.
SQLSESSION 1 >
会话2::
SQL> SET SQLPROMPT "SESSION 2 >"
SESSION 2 >ALTER TABLE TEMP_TEST ADD SEX NUMBER(1) ;
ALTER TABLE TEMP_TEST ADD SEX NUMBER(1)
*
ERROR at line 1:
ORA-14450: attempt to access a transactional temp table already in use
SESSION 2 >
那么此时,会话1是其它用户登录的。比如应用程序等,你不可能要求所有会话都去执行TRUNCATE操作,这个时候该怎么处理呢?
此时你可以使用下面步骤解决这个问题。
Step 1、以sys或system登录数据库,先从DBA_OBJECTS中查询到该表的OBJECT_ID:
SELECT OWNER, OBJECT_ID,OBJECT_TYPE
FROM DBA_OBJECTS
WHERE OBJECT_NAME=&OBJECT_NAME AND OBJECT_TYPE ='TABLE';
Step 2、根据查到的OBJECT_ID知道使用该表的SESSION:
SELECT ADDR, KADDR, SID,LMODE FROM V$LOCK WHERE ID1=&OBJECT_ID;
Step 3、通过下面SQL找到对应的会话并生成KILL SESSION的执行语句
SET COL kill_session FOR A80;
select a.sid, a.serial#,a.status,
a.paddr, 'alter system kill session '''
|| a.sid || ',' || a.serial#
|| ''' immediate;' AS kill_session
FROM v$session a
WHERE a.sid in (select sid from v$enqueue_lock t where t.type='TO')
and a.sid=&sid;
Step 4、查看会话状态,并执行ALTER SYSTEM KILL SESSION语句杀掉这些进程:
具体操作步骤,如下截图所示:
原因: 查看ORA-14450的错误,你可以看到如下信息:
[oracle@oracle-server ~]$ oerr ora 14450
14450, 00000, "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: attempt to access a transactional temp table already in use的更多相关文章
- cannot access the system temp folder
cannot access the system temp folder. please, make sure your application have full control rights on ...
- Access to the temp directory is denied. Identity 'NT AUTHORITY\NETWORK SERVICE' under which XmlSerializer is running does not have sufficient permiss
造成错误的原因是用bat代码清理系统垃圾时造成的权限丢失而引起的 错误描述 1.An error occurred creating the configuration section handler ...
- Oracle temp table
Tow kinds of temp table data keep method. One is delete when commit Anothe one is preseve when commi ...
- temp table
在Oracle8i或以上版本中,可以创建以下两种临时表: 1.会话特有的临时表 CREATE GLOBAL TEMPORARY <TABLE_NAME> ( <column spec ...
- [ DB ] [ SQL ] [ SQL Server ] MS SQL 建立暫存表格 temp table - 轉載
範例 SQL: IF OBJECT_ID(N'tempdb.dbo.#tmp_checkStatusCount', N'U') IS NOT NULL DROP TABLE #tmp_checkSta ...
- Deploying Customizations in Oracle E-Business Suite Release 12.2
DeployingCustomizations in Oracle E-Business Suite Release 12.2 This documentdescribes how to deploy ...
- ORACLE 博客文章目录(2015-05-27更新)
从接触ORACLE到深入学习,已有好几年了,虽然写的博客不多,质量也参差不齐,但是,它却是成长的历程的点点滴滴的一个见证,见证了我在这条路上的寻寻觅觅,朝圣的心路历程,现在将ORACLE方面的博客整理 ...
- Oracle 临时事务表 全局临时表_global temporary table
所有的操作都在一个事务里,事务提交后,此表清空,特别适合做插入删除频率特别高的临时表操作,比如插入完数据就开始查询,查询完就删掉等,用完就扔! 临时表分事务级临时表和会话级临时表. 事务级临时表只对当 ...
- ORA-14450
ORA-14450 attempt to access a transactional temp table already in use Cause: An attempt was made to ...
随机推荐
- 解决ajax跨域请求 (总结)
ajax跨域请求,目前已用几种方法实现: 1)用原生js的xhr对象实现. var url="http://freegeoip.net/json/" ...
- 1Z0-053 争议题目解析702
1Z0-053 争议题目解析702 考试科目:1Z0-053 题库版本:V13.02 题库中原题为: 702.View the Exhibit and examine the parameter se ...
- Oracle RAC客户端tnsnames.ora相关配置及测试
1.Oracle RAC服务端/etc/hosts部分内容如下 2.查看服务端的local_listener和remote_listener参数 3.客户端tnsnames.ora配置参考 3.1 1 ...
- angular使用总结
一.是否有必要加入模块化框架 1.Reqruiejs seajs的主要作用 (1)模块化,让代码易于维护. angular本身就是mvc,模块化很清晰,所以这点用不到requirejs (2)可以按需 ...
- 常见的几个meta标签元素
1.指定字符集: <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/& ...
- github生成静态博客
github生成静态博客很简单. 1.确认你知道你github的用户名,我的叫做chenxing12 2.创建一个项目名字叫做:用户名.github.io 我的用户名叫做chenxing12,所以我创 ...
- CloudNotes云端个人笔记系统系列文章汇总
[CloudNotes版本更新信息与下载地址:http://cloudnotes.cloudapp.net/webapi/Home/Release] [CloudNotes RESTful API帮助 ...
- jQuery美女幻灯相册轮播源代码
体验效果:http://hovertree.com/texiao/jquery/ 本幻灯片包含小图列表和大图轮播,包含图片标题和详细介绍,详细介绍字数可以很多,每张图片包含链接,可以实现跳转 HTML ...
- csharp:ASP.NET SignalR
http://signalr.net/ https://github.com/SignalR/SignalR http://www.asp.net/signalr http://www.cnblogs ...
- C++_系列自学课程_第_4_课_string_《C++ Primer 第四版》
相信学习过计算机编程的人,基本应该都接触过C语言,在C语言中处理字符串大家一定多遇到过, 也都知道处理字符串非常麻烦,而在C++里面,由标准库string类提供对可变长的字符串的支持.下面 来看看st ...