waiting sessions across a RAC database

select dl.inst_id, s.sid, p.spid, dl.resource_name1,
decode(substr(dl.grant_level,1,8),’KJUSERNL’,’Null’,’KJUSERCR’,’Row-S (SS)’,
‘KJUSERCW’,’Row-X (SX)’,’KJUSERPR’,’Share’,’KJUSERPW’,’S/Row-X (SSX)’,
‘KJUSEREX’,’Exclusive’,request_level) as grant_level,
decode(substr(dl.request_level,1,8),’KJUSERNL’,’Null’,’KJUSERCR’,’Row-S (SS)’,
‘KJUSERCW’,’Row-X (SX)’,’KJUSERPR’,’Share’,’KJUSERPW’,’S/Row-X (SSX)’,
‘KJUSEREX’,’Exclusive’,request_level) as request_level,
‘KJUSERCA’,’Cancelling’,’KJUSERCV’,’Converting’) as lockstate,
s.sid, sw.event, sw.seconds_in_wait sec
from gv$dlm_locks dl, gv$process p, gv$session s, gv$session_wait sw
where blocked = 1
and (dl.inst_id = p.inst_id and dl.pid = p.spid)
and (p.inst_id = s.inst_id and p.addr = s.paddr)
and (s.inst_id = sw.inst_id and s.sid = sw.sid)
order by sw.seconds_in_wait desc;

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: