Call now: 252-767-6166  
Oracle Training Oracle Support Development Oracle Apps

 
 Home
 E-mail Us
 Oracle Articles
New Oracle Articles


 Oracle Training
 Oracle Tips

 Oracle Forum
 Class Catalog


 Remote DBA
 Oracle Tuning
 Emergency 911
 RAC Support
 Apps Support
 Analysis
 Design
 Implementation
 Oracle Support


 SQL Tuning
 Security

 Oracle UNIX
 Oracle Linux
 Monitoring
 Remote s
upport
 Remote plans
 Remote
services
 Application Server

 Applications
 Oracle Forms
 Oracle Portal
 App Upgrades
 SQL Server
 Oracle Concepts
 Software Support

 Remote S
upport  
 Development  

 Implementation


 Consulting Staff
 Consulting Prices
 Help Wanted!

 


 Oracle Posters
 Oracle Books

 Oracle Scripts
 Ion
 Excel-DB  

Don Burleson Blog 


 

 

 


 

 

 
 

 

Oracle DB CPU

Oracle Consulting Tips by Burleson

 

 

Also, see these important notes in 100% CPU utilization

The DB CPU Oracle metric is the amount of CPU time (in microseconds) spent on database user-level calls. This does not include the CPU time spent on instance background processes such as PMON.

The most important time model statistics are DB time and DB CPU . The DB time statistic shows the elapsed processing time accumulated from the elapsed times of non-idle sessions. DB CPU presents the cumulative CPU time from all non-idle sessions. Both statistics directly show database workload and describe overall database response time.

The most important statistics within the time model views are DB time and DB CPU. The DB time statistic in the v$sess_time_model view determines the total elapsed processing time spent by database for a particular session.

You will also see the DB CPU statistic in the v$sys_time_model view represents the total cumulative time spent by Oracle for all sessions’ CPU times and wait times spent for non-idle wait events. Therefore, the system-wide DB CPU time can exceed the elapsed time since the last instance startup.  Use the following script to retrieve DB CPU statistics available in v$sys_time_model:

select
stat_name,
Round(value/1000000) "Time (Sec)"
from v$sys_time_model
where stat_name = 'DB CPU';



STAT_NAME Time (Sec)

------------------------------------------ ----------

DB CPU 299,352

Inside Oracle, you can display CPU for any Oracle user session with this script:

select
   ss.username,
   se.SID,
   VALUE/100 cpu_usage_seconds
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.status='ACTIVE'
and
   ss.username is not null
order by VALUE desc;

For complete scripts to monitor CPU, see the Oracle script download.

The Ion tool has a report for the dba_hist_sys_time_model view called DB Time Model Statistics which allows users to quickly build time-series charts for time model statistics  . The time-series charts for db time model statistics allow easy identification of the hot time periods of the database workload.  Figure 4.8 is a representation of the Ion tool report for Time Model Statistics.

Most of the Oracle advisors use the time model approach to perform their work, and DB time is a statistic used as a criterion for tuning and producing the recommendations.

Guy Harrison notes this query for wait events using the v$sys_time_model ASH table:

COLUMN wait_class format a20
COLUMN name       format a30
COLUMN time_secs  format 999,999,999,999.99
COLUMN pct        format 99.99

SELECT   
   wait_class,
   NAME,
   ROUND (time_secs, 2) time_secs,
   ROUND (time_secs * 100 / SUM (time_secs) OVER (), 2) pct
FROM
   (SELECT
      n.wait_class,
      e.event NAME,
      e.time_waited / 100 time_secs
    FROM
      v$system_event e,
      v$event_name n
    WHERE
       n.NAME = e.event AND n.wait_class <> 'Idle'
    AND
       time_waited > 0
    UNION
    SELECT
      'CPU',
      'server CPU',
      SUM (VALUE / 1000000) time_secs
    FROM
      v$sys_time_model
    WHERE
      stat_name IN ('background cpu time', 'DB CPU'))
ORDER BY
   time_secs DESC;

This, and many other Oracle performance metrics are discussed in my book "Oracle Tuning" by Rampant TechPress.  You can buy it directly from the publisher and save 30%.

Here are my related notes on the Oracle DB CPU metric:

 

 


 


 

 

��  
 
 
Oracle Training at Sea
 
 
 
 
oracle dba poster
 

 
Follow us on Twitter 
 
Oracle performance tuning software 
 
Oracle Linux poster
 
 
 

 

Burleson is the American Team

Note: This Oracle documentation was created as a support and Oracle training reference for use by our DBA performance tuning consulting professionals.  Feel free to ask questions on our Oracle forum.

Verify experience! Anyone considering using the services of an Oracle support expert should independently investigate their credentials and experience, and not rely on advertisements and self-proclaimed expertise. All legitimate Oracle experts publish their Oracle qualifications.

Errata?  Oracle technology is changing and we strive to update our BC Oracle support information.  If you find an error or have a suggestion for improving our content, we would appreciate your feedback.  Just  e-mail:  

and include the URL for the page.


                    









Burleson Consulting

The Oracle of Database Support

Oracle Performance Tuning

Remote DBA Services


 

Copyright © 1996 -  2020

All rights reserved by Burleson

Oracle ® is the registered trademark of Oracle Corporation.