---查询死锁
select kaddr::int8, xid, type, '-' as escalation, id1, id2, lmode, ctime/1000 as ctime, case when block=1 then 'true' when block=0 then 'false' end as block from v$lock where xid != (select current_xid from v$session where sid=current_session_id());
---查询死锁-带字段描述
select kaddr::int8 as "锁句柄地址", xid as "事务ID" , type as "锁的类型", '-' as "是否为升级之后的锁", id1 as "对象段ID", id2 as " 对象行ID", lmode as "持有的锁模式", ctime/1000 as "已持有锁的时间", case when block=1 then 'true' when block=0 then 'false' end as "是否 正阻塞其他锁" from v$lock where xid != (select current_xid from v$session where sid=current_session_id());