查找被锁对象的名称、sid,锁定的类型-1123
select lk.sid,lk_obj.object_id,obj.object_name,DECODE(LK.LMODE,0,'None',1,'Null',2,'Row-S (SS)',3,'Row-X (SX)',4,'Share',5,'S/Row-X (SSX)',6,'Exclusive') lmode
from v$locked_object lk_obj,dba_objects obj,v$lock lk
where lk.sid=lk_obj.session_id and lk_obj.object_id=obj.object_id and lk.sid=142;
--version2
col obj.object_name for a15
col lmode for a15
select sess.sid,sess.SERIAL#,lk_obj.object_id,obj.object_name,DECODE(LK.LMODE,0,'None',1,'Null',2,'Row-S (SS)',3,'Row-X (SX)',4,'Share',5,'S/Row-X (SSX)',6,'Exclusive') lmode,to_char(sess.LOGON_TIME,'yyyy-mm-dd hh24:mi:ss') logon_time from v$locked_object lk_obj,dba_objects obj,v$lock lk ,v$session sess where lk.sid=lk_obj.session_id and lk_obj.object_id=obj.object_id order by sess.LOGON_TIME desc;