-------------------------------------------------------------------
-- Well known stuff but I haven't tested this code at all!
-- The magic of cut and paste....
-------------------------------------------------------------------
select o.object_name "Obj Name",
  o.object_type "Obj Type",
  s.sid "Session ID",
  s.serial# "Serial #",
  s.username "User",
  s.osuser "OS User",
  l.type "Lock Type",
  decode (l.lmode,
    0, 'None',
    1, 'Null',
    2, 'Row Share',
    3, 'Row Exclusive',
    4, 'Share',
    5, 'Sh Row Excl',
    6, 'Exclusive',
    'Null') "Lock Mode",
  decode (l.request,
    0, 'None',
    1, 'Null',
    2, 'Row Share',
    3, 'Row Exclusive',
    4, 'Share',
    5, 'Sh Row Excl',
    6, 'Exclusive',
    to_char (request)) "Req Mode"
from dba_objects o,
  v$lock l,
  v$session s
where l.id1 = o.object_id
and s.sid = l.sid
and s.username is not null
/