要管理员权限才能查询
--查看被锁的表,锁表的人
select b.owner,b.object_name,a.session_id,a.locked_mode from v$locked_object a,dba_objects b where b.object_id = a.object_id;
--查看进程信息,可获得 SID 和 SERIAL#
select b.username,b.sid,b.serial#,logon_time from v$locked_object a,v$session b where a.session_id = b.sid order by b.logon_time;
--解锁命令:要先查 SID 和 SERIAL#
ALTER SYSTEM KILL SESSION 'SID,SERIAL#';