ITPub博客

首页 > 数据库 > Oracle > ORA-14452

ORA-14452

原创 Oracle 作者:Wake_Lee 时间:2017-06-01 07:14:49 0 删除 编辑
ORA-14452: attempt to create, alter or drop an index on temporary table already in use。
昨天下午下班后系统升级,应客户要求修改了某个报表的过程包。在修改过程中,由于该改动较大,要修改其中一些临时表的表结构,故在升级时需要先删除相关表然后再重新创建相关表。而此时,在删表的时候发生了报错。ORA-14452: attempt to create, alter or drop an index on temporary table already in use。
该报错是由于之前某个会话在使用该临时表后未能及时释放,造成该临时表被占用,故无法对其表结构删除、修改或对其创建、修改索引。
解决方法:
1.可以将该临时表的表结构复制一份,然后rename其表名(语法:rename &old_tablename to &new_tablename;),再按刚复制的表结构重新创建。等会话释放后删除rename后的临时表。
2.找出占用会话,然后 alter system kill session 'Sid,seria#l';
 详细步骤:
 (1)根据表名在dba_objects、all_objects或user_objects数据字典中查找其对象id
         select object_id from user_objects where object_name = &tablename;
 (2)根据查到的对象id到v$lock动态视图中查找占用该临时表的会话id
         select sid from v$lock where id1 = &object_id;
 (3)根据查到的sid到v$session动态视图中找到该会话的信息
         select * from v$session where Sid = &sid;
 (4)杀掉该会话
         alter system kill session '&sid,&serial#' immediate;

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/31017950/viewspace-2140144/ ,如需转载,请注明出处,否则将追究法律责任。

上一篇: 没有了~
请登录后发表评论 登录
全部评论

注册时间:2016-03-13

  • 博文量
    7
  • 访问量
    5370