반응형
/****************************************************************************************************************
-- Title : [SQL2012] Query for getting CPU Usage of Database Server
-- Reference : sqlmag.com
-- Key word : cpu monitoring 모니터링
****************************************************************************************************************/
-- Query
SELECT (@@CPU_BUSY - @CPU_BUSY) / ((@@IDLE - @IDLE + @@CPU_BUSY - @CPU_BUSY) * 1.00) * 100 AS CPU_Busy_Pct;
-- Test
o make some query using hash join hint.
o monitoring cpu usage with query above.
-- Title : [SQL2012] Query for getting CPU Usage of Database Server
-- Reference : sqlmag.com
-- Key word : cpu monitoring 모니터링
****************************************************************************************************************/
-- Query
DECLARE @CPU_BUSY int, @IDLE int;
SELECT @CPU_BUSY = @@CPU_BUSY, @IDLE = @@IDLE;
WAITFOR DELAY '000:00:01';
-- Test
o make some query using hash join hint.
o monitoring cpu usage with query above.
반응형