繁体   English   中英

无法在 Oracle 12c 中删除 GTT

[英]Not able to drop GTT in Oracle 12c

我不会在 Oracle 12c 中放弃gtt 我不知道哪个session正在保留待处理的交易。 on commit preserve rows表。

drop  TABLE pjm.pjm_ecc_gtt1
Error report -
ORA-14452: attempt to create, alter or drop an index on temporary table already in use
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.

我怎样才能强行中止 session 并将其丢弃。 我知道v$session但我怎么知道哪个 session 使用我的表。

我被截断了,但仍然无法删除。

使用以下查询获取已阻止它的 session。

SELECT 'USER: '||s.username||' SID: '||s.sid||' SERIAL #: '||S.SERIAL# "USER HOLDING LOCK"
FROM v$lock l
,dba_objects o
,v$session s
WHERE l.id1 = o.object_id
AND s.sid = l.sid
AND o.owner = 'SSI' --user name
AND o.object_name = 'ABC_ECC_GTT1'; --table name

然后运行

alter system kill session 'sid, serial#';

在杀死 session 之前,请询问持有者,礼貌地关闭 session。 杀死 session 应该是最后一个选项。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM