Please use the below query.
set line size 750 pages 9999
col box for a30
col username for a30
col spid for a30
col program for a30
col os_user for a20
col logon_time for a20
select b.inst_id,b.sid,b.serial#,a.spid,substr(b.machine,1,30)box,to_char(b.logon_time,’dd-mon-yyyy hh24:mi:ss’)logon_time,substr(b.username,1,30)username,substr(b.osuser,1,20)os_user,substr(b.program,1,30)program,status,b.last_call_et AS last_call_et_secs,b.sql_id from gv$session b,gv$process a where b.paddr=a.addr and a.inst_id=b.inst_id and type=’USER’ order by logon_time;
Recent Posts