Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL for lcoked sessios

Status
Not open for further replies.

Thiko

Programmer
Mar 9, 2001
49
0
0
GB
Hi

How can i find out the sql for a session that is locking rows at the actual time when it was happening? Many Thanks!

Thiko!
 
SELECT s.username, l.type, o.object_name,
DECODE(l.lmode, 2, 'Row-S(SS)',
3,'Row-X(SX)',
4, 'Share',
5, 'S/Row-X(SSX)',
6, 'Exclusive', 'Other' Mode_Held,
FROM dba_objects o, v$session s, v$lock l
WHERE s.sid = l.sid
AND o.object_id = l.id1
AND s.username is not null;
 
Great thanks!!

What is the Row-S(SS) telling me in the results?


DECODE(L.LMO
------------
Row-S(SS)
Row-S(SS)
Many Thanks!

Thiko!
 
It tells you that a shared row-level lock is being held (two of them in your case)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top