Oracle Consulting Oracle Training Oracle Support Development
Oracle Books
SQL Server Books
IT Books
Job Interview Books
Rampant Horse Books
911 Series
Pedagogue Books

Oracle Software
Write for Rampant
Publish with Rampant
Rampant News
Rampant Authors
Rampant Staff
Oracle News
Oracle Forum
Oracle Tips
Articles by our Authors
Press Releases
SQL Server Books

Oracle 11g Books

Oracle tuning

Oracle training

Oracle support

Remote Oracle


Privacy Policy


  SQL Server Tips by Burleson

Examining CPU Activity

In terms of CPU activity, a query can be issued and the system statistical function @@CPU_BUSY can be selected. It shows time in milliseconds that the CPU has spent working since SQL Server was started. This is a steadily increasing number and is best viewed via a monitor or procedure that can compute differences between sampled intervals, along with a comparison of @@IDLE. This function is a millisecond measurement of how idle SQL Server has been since startup.

Some sources indicate that @@CPU_BUSY has to be multiplied by @@TIMETICKS to get the actual time in milliseconds. This claim does not appear to be valid. Testing by some savvy SQL Server DBAs has determined that @@CPU_BUSY has to be multiplied by @@TIMETICKS and then divided by the number of CPUs on the server to get the actual time. To validate this on the box, the following test_time T-SQL code can be run:

* test_time.sql

-- Script is available in the Online Code Depot

The CPU count number of four in the above T-SQL code would have to be replaced with the actual number of processors the machine has in order to get the proper numbers out on the box.

The easiest approach to obtaining current CPU activity is to simply use the Microsoft Task Manager and locate SQL Server executable. Task Manager can give real time and historical peaks/dips that have occurred since the monitor has been running.

The above book excerpt is from:

High-Performance SQL Server DBA
Tuning & Optimization Secrets

ISBN: 0-9761573-6-5
Robin Schumacher  

Linux Oracle commands syntax poster

ION Oracle tuning software

Oracle data dictionary reference poster

Oracle Forum

BC Oracle consulting support training

BC remote Oracle DBA   



 Copyright © 1996 -2017 by Burleson. All rights reserved.

Oracle® is the registered trademark of Oracle Corporation. SQL Server® is the registered trademark of Microsoft Corporation. 
Many of the designations used by computer vendors to distinguish their products are claimed as Trademarks

Hit Counter