clear breaks
set lines 500
set pages 500
set head on
set feedback on
column sid format A3
column client_info format A30
column program format A33
column inactif format A9
select to_char(sid) SID, SERIAL#,substr(USERNAME,1,13) USERNAME,substr(OSUSER,1,19) OSUSER,
        substr(MACHINE,1,20) MACHINE,STATUS, -- TERMINAL,
	substr(rtrim(trim(to_char(trunc(last_call_et/3600), '99900')||':'||trim( to_char(trunc(mod(last_call_et,3600)/60),'00'))||':'||trim( to_char(mod(last_call_et,60),'00')))),1,11) INACTIF,
	logon_time,process,program,client_info
from v$session
where username is not null
order by username,machine,terminal
/
