Find out CPU expensive session

Friday Aug 19th 2005 by DatabaseJournal.com Staff
Share:

This script finds expensive CPU usage on Oracle server.



>>Script Language and Platform: Oracle
This script finds expensive CPU usage on Oracle server.

Author: Mark.Brown


 --
-- Author:      AgileInfoSoftware LLC
-- Web:         http://www.agileinfollc.com
-- Date:        08/16/2005
-- Description: Find out CPU expensive session
-- Usage:       @expensive_session.txt
--

SELECT substr(a.sid,1,5) "Sid",
       substr(a.process,1,7) "Process",
       substr(a.username,1,20) "User",
       v.value "CPU used by this session"
  FROM v$statname s, v$sesstat v, v$session a
 WHERE s.name = 'CPU used by this session'
   and v.statistic#=s.statistic#
   AND v.sid = a.sid
   and v.value > 1000
ORDER BY v.value DESC;

Disclaimer: We hope that the information on these script pages is valuable to you. Your use of the information contained in these pages, however, is at your sole risk. All information on these pages is provided "as -is", without any warranty, whether express or implied, of its accuracy, completeness, or fitness for a particular purpose... Disclaimer Continued


Back to Database Journal Home

Share:
Home
Mobile Site | Full Site
Copyright 2017 © QuinStreet Inc. All Rights Reserved