select distinct ss.sid, ','||ss.serial# serial,
       ss.username,
       to_char(ss.logon_time, 'DD-MON HH24:MI') logon,
       su.blocks*8192/1024/1024 mb,
       substr(sq.sql_text,1,50) sqltext
from gv$session ss,
     gv$sort_usage su,
     gv$sql sq
where ss.inst_id = su.inst_id
  and ss.inst_id = sq.inst_id
  and ss.saddr = su.session_addr
  and ss.sql_address = sq.address
/
