Home » RDBMS Server » Performance Tuning » CPU used by user SQLs (11g RHEL 5)
CPU used by user SQLs [message #467116] Thu, 22 July 2010 05:05 Go to next message
asangapradeep
Messages: 128
Registered: October 2005
Location: UK
Senior Member
We have a two node RAC each with 8 CPUs. I run the following sql to get the number of sqls and CPU seconds consumed by two users.

Select to_char(dhs.begin_interval_time,'YYYY-MM-DD HH24') as time,sum(dhsq.executions_delta) as execs, round(sum(dhsq.cpu_time_delta)/1000000) as cpu From Dba_Hist_Snapshot Dhs, Dba_Hist_Sqlstat Dhsq Where Dhs.Snap_Id = Dhsq.Snap_Id And Dhsq.Parsing_Schema_Name in ('A','B') and dhsq.instance_number=1 GROUP BY to_char(dhs.begin_interval_time,'YYYY-MM-DD HH24') order by 1

another sql for instance number 2.

What does it mean in practice when the values in the CPU column exceed the total number of CPU available in the server? In this case each server will have 8 * 60 * 60 = 28800 CPU seconds per hour.
But I see over 30000 sometimes. But sar output doesn't seem to have 99% CPU, at highest we get 78%.
Since it's a RAC assuming some cpu time comes from the other node I've checked the combined values for the hour and even that at times exceeds 2 * 28800.

Found this on the web which says Quote:
unless you use more than 28800 CPU seconds within the hour, you are under your 100% CPU limit.


So my questions are
1. Is the SQL written is valid to get number CPU seconds used?
2. When the cpu column value exceed the server cpu capacity does this means CPU saturation? How it is possible that more cpu seconds have been consumed than the system capacity?

[Updated on: Thu, 22 July 2010 11:20]

Report message to a moderator

Re: CPU used by user SQLs [message #467227 is a reply to message #467116] Thu, 22 July 2010 14:55 Go to previous messageGo to next message
asangapradeep
Messages: 128
Registered: October 2005
Location: UK
Senior Member
it seem oracle doesn't count the cpu seconds until call finishes, so a call can start in one hour and finish in another hour adding to the cpu usage of that hour so the total used cpu seconds seems higher than the available capacity. At least that's what said here
Re: CPU used by user SQLs [message #467229 is a reply to message #467227] Thu, 22 July 2010 15:03 Go to previous message
Michel Cadot
Messages: 68648
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Yes, this is the case, cpu retrieved and stored by Oracle at the end of each call.

Regards
Michel
Previous Topic: index on foreign keys
Next Topic: sql hint
Goto Forum:
  


Current Time: Sat May 04 08:50:03 CDT 2024