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

 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
 Oracle Support

 SQL Tuning

 Oracle UNIX
 Oracle Linux
 Remote s
 Remote plans
 Application Server

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

 Remote S


 Consulting Staff
 Consulting Prices
 Help Wanted!


 Oracle Posters
 Oracle Books

 Oracle Scripts

Don Burleson Blog 







How to Monitor CPU usage in UNIX

Oracle Database Tips by Donald BurlesonJuly 29,  2015

Monitoring CPU usage within UNIX is easy with the vmstat utility and vmstat can be used to track CPU usage via the ?runqueue? column. Whenever the us (user) plus sy (system) times approach 100, the CPUs are operating at full capacity.  For details, see the fallacy of 100% CPU utilization.

You can use the "ps" command to find the top CPU consumers on a UNIX/Linux server.  Below we find the Process ID which is hogging CPU/Memory:

$ ps -e -o pcpu,pid,user,tty,args |grep -i oracle|sort -n -k 1 -r|head

When monitoring CPU utilization, it is not a cause for concern when the user + system CPU values approach 100 percent. This just means that the CPUs are working to their full potential. The only metric that identifies a CPU bottleneck is when the run queue (r value) exceeds the number of CPUs on the server.

vmstat 5 1

kthr     memory             page              faults        cpu    
----- ----------- ------------------------ ------------ -----------
 r  b   avm   fre  re  pi  po  fr   sr  cy  in   sy  cs us sy id wa
 3  0 217485   386  0   0   0   4   14   0 202  300 210 20 75  3  2

Long term monitoring of CPU consumption

Within UNIX, the OS is geared to drive CPU consumption to 100%, so the best way to monitor CPU usage is by tracking the ?r? column in vmstat.  See these notes on monitoring Oracle CPU consumption for details.

This script will store CPU usage every five minutes and store the results in an Oracle table, perfect for time-series monitoring of UNIX/Linux CPU usage.

Once stored in a table, standard SQL can be used to monitor CPU usage and display those times when the runqueue exceed the CPU count of the UNIX/Linux server.

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


   VALUE/100 cpu_usage_seconds
   v$session ss,

   v$sesstat se,
   v$statname sn

   NAME like '%CPU used by this session%'

   se.SID = ss.SID


   ss.username is not null

order by VALUE desc;

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




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.