rem Name: NOW.sql - SQLText executing now rem Date: 1-nov-2002 rem Note: If users_executing=0 then it's the last statement of an idle user. set line 100 set pages 60 lines 100 feed OFF wrap on col SID for 999 col username for A10 trunc col osuser for A10 trunc col now for A5 head 'Exec|now' col buffer_gets for 9999999 head "Buffer|reads" col disk_reads for 999999 head "Disk|reads" col executions for 999999 head 'Execs' col rows_processed for 999999 head 'rows|procesd' col firstload head 'First|load' col sql_text for A35 select SID ,S.username ,S.OSuser ,decode(A.users_executing,0,'*idle',A.users_executing) NOW ,A.buffer_gets ,A.executions ,A.rows_processed ,substr(A.first_load_time,12,5) Firstload ,A.sql_text from v$SQLAREA A ,v$SESSION S where A.address = S.sql_address and S.audsid != userenv('SESSIONID') order by now,SID /