SQL query for servers by Total Physical Memory usage and CPU Usage in single table

Document ID : KB000010111
Last Modified Date : 14/02/2018
Show Technical Document Details
Introduction:

SQL query for servers by Total Physical Memory usage and CPU Usage in single table

Environment:
Any UIM VersionSQL Query
Instructions:

select a.customer

,a.source

,a.Date2

,CONVERT(DECIMAL(10,2),a.cpu)as cpu

,CONVERT(DECIMAL(10,2),b.mem)as memory

 from

(

SELECT cpu.origin as customer

,cpu.sourceassource

,CONVERT(char(8),cast(cpu.sampletime asdatetime), 112)as Date2

,avg(cpu.samplevalue)as cpu

FROM [CA_UIM].[dbo].[V_QOS_CPU_USAGE] CPU

where CPU.origin ='rc82_phub'

groupbyCONVERT(char(8),cast(cpu.sampletime asdatetime), 112), cpu.source,cpu.origin

) a

fulljoin

(

SELECT mem.origin as customer

,mem.sourceassource

,CONVERT(char(8),cast(mem.sampletime asdatetime), 112)as Date2

 ,avg(mem.samplevalue)as mem

FROM [CA_UIM].[dbo].[V_QOS_MEMORY_PHYSICAL_PERC] mem

where mem.origin ='rc82_phub'

groupbyCONVERT(char(8),cast(mem.sampletime asdatetime), 112), mem.source,mem.origin

) b on a.customer = b.customer and a.source= b.sourceand a.date2 = b.date2

orderby a.date2 desc

Additional Information:

NOTE: CA Support will not provide further info about this Query, if you need more details please Engage your DBA or CA Services Team