-- /***********************************************************************************
-- **  Copyright(c) 1999 - Delphi Technology, Inc., 201 Broadway,  Cambridge, MA 02139
-- **
-- **  Name:        locks.SQL
-- **  Description: Display info on locks
-- **
-- **  Arguments:   None              
-- **
-- **  Notes:       
-- **
-- **  Created by:  Christopher Spence
-- **  Created on:  January, 08 2000
-- **
-- **  Modifications:
-- **  Date      By          Purpose
-- **  mm/dd/yy  <Name>      <Description>
-- ************************************************************************************
-- **  
-- ***********************************************************************************/

-- record our current settings so that we can set everything back to the
-- originals later on
store set origenv.sql repl

set pagesize 60
set linesize 132

select s.username username,
			 a.sid sid,
			 a.owner || '.' || a.object object,
			 s.lockwait,
			 t.sql_text SQL
  from v$sqltext t,
	     v$session s,
			 v$access a
 where t.address = s.sql_address
   and t.hash_value = s.sql_hash_value 
	 and s.sid = a.sid
	 and a.owner != 'SYS'
	 and upper(substr(a.object,1,2)) != 'V$'
 order by owner
/

-- Restore Settings
clear columns
@origenv.sql

