[英]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.