无法在 Oracle 12c 中删除 GTT

Not able to drop GTT in Oracle 12c

我不会在 Oracle 12c 中删除 gtt。我不知道哪个 session 正在保留未决交易。这是 on commit preserve rows table.

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.

如何强行中止会话并将其删除。我知道 v$session 但我怎么知道哪个会话使用我的 table.

我截断了,还是没能放下

使用以下查询获取阻止它的会话。

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#';

在终止会话之前,要求持有的用户礼貌地关闭会话。终止会话应该是最后一个选项。