SQL> select session_id from v$locked_object;
SESSION_ID
----------
142
SQL> SELECT sid, serial#, username, osuser FROM v$session where sid = 142;
SID SERIAL# USERNAME OSUSER
---------- ---------- ------------------------------ ------------------------------
142 38 SCOTT LILWEN
SQL> ALTER SYSTEM KILL SESSION '142,38';
System altered
--》》》》》》》》》》》》》》查询具体的语句sql和表
select inst_id,session_id,object_id,locked_mode from v$locked_object;
select vs.inst_id,vs.sid,vs.SERIAL#,vs.MACHINE,vs.MODULE,vs.SQL_ID,vq.SQL_TEXT from gv$session vs ,gv$sql vq
where vs.inst_id=&inst_id and vs.sid=&session_id and vs.sql_id=vq.SQL_ID;