Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Mon, 18 Feb 2013 @ 09:23:17 GMT


     
  <Prev Next>  
<<First
<Prev
Next> Last>>  


Subj:   Validate CPU Usage query
 
From:   Bakthavachalam, Roopalini

Hi Forum,

After reading the Resusage manual, I came up with the below query to calculate the CPU usage for a day. Could anyone please validate ?

     SELECT THEDATE,
         CAST(CAST(CAST(THETIME AS FORMAT '99:99:99.99') AS CHAR(11)) AS TIME(6)) AS TIME_OF_DAY,
         CPUUEXEC/100,
         CPUUSERV/100,
         CPUIOWAIT/100,
         CPUIDLE/100,
         (CPUUEXEC + CPUUSERV) /100 AS CPU_BUSY_IN_SECS,
         (CPUIOWAIT+CPUIDLE) /100 AS CPU_IDLE_IN_SECS,
         ((CPUUEXEC + CPUUSERV) / (CPUUEXEC + CPUUSERV+CPUIOWAIT+CPUIDLE) ) *100 AS CPU_BUSY_PCT,
         ((CPUIOWAIT+CPUIDLE) / (CPUUEXEC + CPUUSERV+CPUIOWAIT+CPUIDLE) ) *100 AS CPU_IDLE_PCT

     FROM DBC.RESUSAGESPMA
     WHERE THEDATE > (CURRENT_DATE - INTERVAL '1' DAY)

Thanks

Roopalini



     
  <Prev Next>  
<<First
<Prev
Next> Last>>  
 
 
 
 
 
 
 
 
  
  Top Home Privacy Feedback  
 
 
Copyright for the TeradataForum (TDATA-L), Manta BlueSky    
Copyright 2016 - All Rights Reserved    
Last Modified: 15 Jun 2023