doc

    Name:    lockproc.sql

    Author:  Mark Gurry

    This script shows the operating system process that is being locked
    out.

#

select ses.username||'('||sid||')'  users, acc.owner owner,
       acc.object object, ses.lockwait, prc.osuser os_process
  from  v$process prc, v$access acc, v$session ses
  where   prc.addr         = ses.paddr
    and   ses.sid          = acc.sid
    and   ses.lockwait     is not null;