今天在删除临时表的时候出现如下报错信息:
-
SQL> drop table sys_event_session;
-
drop table sys_event_session
-
*
-
ERROR at line 1:
-
ORA-14452: attempt to create, alter or drop an index on temporary table already
-
in use
之前该表的建表语句如下:
-
SQL> create global temporary table sys_event_session
-
2 on commit preserve rows
-
3 as
-
4 select *
-
5 from v$system_event
-
6 where 1 = 0;
-
-
Table created.
-
-
SQL> insert into sys_event_session
-
2 select * from v$system_event;
在linux环境下执行:oerr ora 14452 显示如下:
-
[oracle@centos5 ~]$ oerr ora 14452
-
14452, 00000, \"attempt to create, alter or drop an index on temporary table already in use\"
-
// *Cause: An attempt was made to create, alter or drop an index on temporary
-
// table which is already in use.
-
// *Action: All the sessions using the session-specific temporary table have
-
// to truncate table and all the transactions using transaction
-
// specific temporary table have to end their transactions.
通过Action不难发现,只需要在drop table tablename之前执行truncate table tablename即可。如下:
-
SQL> truncate table sys_event_session;
-
-
Table truncated.
-
-
SQL> drop table sys_event_session;
-
-
Table dropped.
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/29173997/viewspace-1126224/
,如需转载,请注明出处,否则将追究法律责任。