doc

    Name:    locksql.sql

    Author:  Mark Gurry

    This script shows the SQL that people who are currently being locked
    are trying to run.

#

select ses.username||'('||sid||')'  users, acc.owner owner,
           acc.object object, ses.lockwait, txt.sql_text sqltext
  from v$sqltext txt, v$access acc, v$session ses
 where txt.address = ses.sql_address
  and    txt.hash_value   = ses.sql_hash_value
  and    ses.sid          = acc.sid
  and    ses.lockwait     is not null;