set lines 132
set pagesize 1000
column NAME for a4
column USERNAME for a14
column UNIXPID for a7
column OSUSER for a9
column SID for 9999
column SERIAL# for 99999
column TOTALIO for 999,999,999,999,999
column SERVER for a10
col LOGIN_TIME format a12
col HOUR format a8
select p.spid unixpid,
s.username,
s.osuser,
s.sid sid,
s.serial# serial#,
i.block_gets+i.block_changes+i.consistent_gets+
i.consistent_changes+i.physical_reads totalio,
s.server server,
to_char(s.logon_time,'DD/MM HH24:MI') LOGIN_TIME,
to_char(round(c.seconds_in_wait/3600,0))||'.'||
to_char(round(mod(c.seconds_in_wait,3600)/60,0)) HOUR
from v$session s,
     v$sess_io i,
     v$process p,
     v$session_wait c
where s.sid=i.sid(+)
and s.paddr=p.addr(+)
and s.sid=c.sid
and s.username is not null
order by s.username;
