解决步骤:
找出被哪些会话占用,将该会话的进程杀掉就可以了。 先从DBA_OBJECTS/ALL_OBJECTS /USER_OBJECTS中查询到该表的OBJECT_ID:
SELECT OBJECT_ID FROM USER_OBJECTS WHERE OBJECT_NAME="TMP_TEST";
根据查到的OBJECT_ID知道使用该表的SESSION:
SELECT * FROM V$LOCK WHERE ID1=&OBJECT_ID;
在从v$session视图中查到该session的SID和SERIAL#:
SELECT * FROM V$SESSION WHERE SID=&SID;
登录sys用户或dba杀掉这些进程:
ALTER SYSTEM KILL SESSION "SID, SERIAL#";