col ORACLE_USERNAME for a13
col OS_USER_NAME for a10
col object_name for a40
PROMPT "PRESSS ENTER FOR ALL SIDs"
select a.ORACLE_USERNAME,a.OS_USER_NAME,a.SESSION_ID,b.ob ject_name,c.NAME "RBS NAME",
decode(a.LOCKED_MODE,1,'No Lock',2,'Row Share',3,'Row Excl',4,'Share',5,'Shr Row Excl',6,'Exclusive',null) "LOCK MODE",
d.module
from v$locked_object a,dba_objects b,v$rollname c,v$session d
where a.OBJECT_ID=b.object_id
and a.XIDUSN=c.USN
and a.session_id=d.sid
and a.SESSION_ID like '%&sid%'
order by session_id
/