Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2011-03-03
3
Medium Priority
?
628 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 960 total points
ID: 35033390
0
 
LVL 15

Accepted Solution

by:
Aaron Shilo earned 1040 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

Have you ever had to make fundamental changes to a table in Oracle, but haven't been able to get any downtime?  I'm talking things like: * Dropping columns * Shrinking allocated space * Removing chained blocks and restoring the PCTFREE * Re-or…
How to Unravel a Tricky Query Introduction If you browse through the Oracle zones or any of the other database-related zones you'll come across some complicated solutions and sometimes you'll just have to wonder how anyone came up with them.  …
Via a live example show how to connect to RMAN, make basic configuration settings changes and then take a backup of a demo database
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Suggested Courses

885 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