wait.sql

Rem SID = Session identifier
Rem SER = Session serial number
Rem OSUER = Operating system username
Rem OSPID = Operating system process identifier
Rem STAT = Status of session (ACT=active INA=Inactive)
Rem COM = Command number.  Definition listed in table Audit_actions
Rem SCHEMA = Oracle username
Rem TYP = Type of process (USE=user BAC=background)
Rem %HIT = Hit ratio in percent
Rem CPU = CPU being used
Rem BCHNG = Block changes
Rem CCHNG = Consistent changes
Rem
set lines 150;
select substr(s.sid,1,3) sid,substr(s.serial#,1,5) ser,
substr(osuser,1,8) osuser,
substr(status,1,3) stat,substr(command,1,3) com,
substr(schemaname,1,10) schema,
substr(s.program,1,5),
sw.seconds_in_wait SEC, sw.state
from v$session s, v$session_wait sw
where sw.sid=s.sid  
and substr(s.program,1,3)='LOS' 
order by sw.seconds_in_wait desc
/