cpu.sql
column parameter noprint; column user_process format a30 column value format 999,999,999.99 set pagesize 999 -- set feedback off set echo off set verify off spool cpu.txt ttitle ' CPU Used By Session Information ' select substr(name,1,30) parameter, ss.username||'('||se.sid||') ' user_process, value from v$session ss, v$sesstat se, v$statname sn where se.statistic# = sn.statistic# and name like '%CPU used by this session%' and se.sid = ss.sid and ss.username is not null order by substr(name,1,25), value desc / spool off