Solved

how to get CPU usage for the running porgram/process in 11gR1

Posted on 2011-03-03
3
623 Views
Last Modified: 2012-05-11
Are there any system views I can look into to get CPU usage for the running programs from the query?
select USERNAME,PROGRAM, terminal from v$session where username is not null;
0
Comment
Question by:jl66
3 Comments
 
LVL 2

Assisted Solution

by:niaz
niaz earned 240 total points
ID: 35033390
0
 
LVL 15

Accepted Solution

by:
Aaron Shilo earned 260 total points
ID: 35034032
by user/app

SELECT n.username,
s.sid,
s.value
FROM v$sesstat s,v$statname t, v$session n
WHERE s.statistic# = t.statistic#
AND n.sid = s.sid
AND t.name=’CPU used by this session’
ORDER BY s.value desc;

session level

select * from v$sesstat
  where statistic# = 12
  order by value desc;

CPU usage for parsing

select (a.value / b.value)*100 “% CPU for parsing”
from V$SYSSTAT a, V$SYSSTAT b
where a.name = ‘parse time cpu’
and b.name = ‘CPU used by this session’;

To determine percentage of Recursive CPU Usage

select (a.value / b.value)*100 “% recursive cpu usage”
from V$SYSSTAT a, V$SYSSTAT b
where a.name = ‘recursive cpu usage’
and b.name = ‘CPU used by this session’;

This sould get you started
0
 

Author Closing Comment

by:jl66
ID: 35037661
Thank both of you.
0

Featured Post

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Truncate is a DDL Command where as Delete is a DML Command. Both will delete data from table, but what is the difference between these below statements truncate table <table_name> ?? delete from <table_name> ?? The first command cannot be …
Introduction A previously published article on Experts Exchange ("Joins in Oracle", http://www.experts-exchange.com/Database/Oracle/A_8249-Joins-in-Oracle.html) makes a statement about "Oracle proprietary" joins and mixes the join syntax with gen…
This video shows setup options and the basic steps and syntax for duplicating (cloning) a database from one instance to another. Examples are given for duplicating to the same machine and to different machines
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…

821 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question