Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: cpu time estimation

Re: cpu time estimation

From: Chris Holland <hollachr_at_it.postoffice.co.uk>
Date: Thu, 29 Oct 1998 16:01:35 -0000
Message-ID: <71a3hl$557$1@igateway.postoffice.co.uk>


>On Thu, 22 Oct 1998, Stephania Panagopoulos wrote:
>>
>> I want to know if there is any tools available which allows me to
>> monitor CPU time allocation on running ORACLE type processes.
>

Try something like

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 sesscpu.lis
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 /

You could also try using tkprof if it is a particular piece of sql that you are interested in :-

set timed_statistics = true (in init.ora)

restart oracle

sqlplus

alter session set sql_trace = true

run your piece of sql

exit sqlplus

cd to your user_dump_dest

now make a note of the latest trace file created

type
tkprof tracefilename tkprof.out explain=system/manager sys=no

this will create a file called tkprof.out with details of sql stats.

Remember to turn timed_statistics off afterwards. Received on Thu Oct 29 1998 - 10:01:35 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US