Query OracleCPU usage
-- The SQL statements that run a large number of PARSEselect SQL _text, parse_cils, executions from v $ sqlarea order by parse_cils desc; -- select name of the total PARSE of SYS, value from v $ sysstat where name like 'parse count % '; -- select * from v $ osstat for CPU space and busy conditions -- view the CPU usage of each Session: select ss. sid, se. command, ss. value CPU, se. username, se. program from v $ sesstat ss, v $ session se where ss. statistic # in (select statistic # from v $ statname where name = 'cpu used by this session') and se. sid = ss. sid and ss. sid> 6 order by CPU desc; -- compare which session has the most CPU usage time and view the Session details: select s. sid, s. event, s. MACHINE, s. OSUSER, s. wait_time, w. seq #, q. SQL _text from v $ session_wait w, v $ session s, v $ process p, v $ sqlarea q where s. paddr = p. addr and s. sid = & p and s. SQL _address = q. address; -- select s. sid, w. wait_time, w. seconds_in_wait, w. state, w. wait_time_micro, w. time_remaining_micro, w. time_since_last_wait_micro, p. USERNAME, status, server, schemaname, osuser, machine, p. terminal, p. program, logon_time, w. event, w. wait_class, tracefile, SQL _text, last_active_time from v $ session_wait w, v $ session s, v $ process p, v $ sqlarea q where s. paddr = p. addr and s. sid in (select sid from (select ss. sid from v $ sesstat ss, v $ session se where ss. statistic # in (select statistic # from v $ statname where name = 'cpu used by this session') and se. sid = ss. sid and ss. sid> 6 order by ss. value desc) where rownum <11) and s. SQL _address = q. address;