一、先查询用户的session会话。
二、kill语句杀掉被锁进程(必须使用immediate语句,立即释放资源)。
语句:
select o.object_type,
o.object_name,
l.OS_USER_NAME,
l.ORACLE_USERNAME,
'session' v_$session,
s.*,
'lock' locked_object,
l.*,
'object' objects,
o.*
from sys.v_$locked_object l, sys.all_objects o, sys.v_$session s
where l.OBJECT_ID = o.object_id
and l.SESSION_ID = s.SID
order by o.object_type, o.object_name;
select t2.username, t2.sid, t2.serial#, t2.logon_time
from v$locked_object t1, v$session t2
where t1.session_id = t2.sid
order by t2.logon_time;
alter system kill session '151,45159' immediate;