After capturing the data in the tables ( link here - http://sql-dba-online.blogspot.com/2015/02/performance-monitor-how-to-run-relog-to.html) The following script will help to analyze the data.
/*show data collected for specific collector set, ordered by counter and time */
SELECT * from counterData cd
JOIN DisplayTOId di
ON cd.[GUID] = di.[GUID]
JOIN counterdetails cdt
ON cdt.[counterID] = cd.[counterID]
WHERE di.[DisplayString] = 'ProdSample.blg'
ORDER BY cdt.[ObjectName],
cdt.[CounterName],cd.[RecordIndex]
/* List max,min,avg,stdev for each counter for a specific collector*/
SELECT CONVERT(VARCHAR(10),cd.counterDateTime, 101) AS "collection" ,
RTRIM(cdt.objectName) + '\' + rtrim(cdt.CounterName) +
Case
WHEN cdt.InstanceName IS NULL then ''
WHEN cdt.instanceName is not null then '_' + rtrim(cdt.InstanceName)
END as "Counter",
CAST (MIN(cd.CounterValue) AS Decimal(6,0)) AS "Minimum",
CAST (MAX(cd.CounterValue) AS Decimal(6,0)) AS "Maximum",
CAST (AVG(cd.CounterValue) AS Decimal(6,0)) AS "Average",
CAST (STDEV(cd.CounterValue) AS Decimal(6,0)) AS "StDev"
FROM counterData cd
JOIN DisplayTOId di
ON cd.[GUID] = di.[GUID]
JOIN counterdetails cdt
ON cdt.[counterID] = cd.[counterID]
WHERE di.[DisplayString] = 'ProdSample.blg'
GROUP BY CONVERT(VARCHAR(10),cd.counterDateTime, 101),cdt.objectName,cdt.CounterName,cdt.instanceName
This blog is created to add all the information and experiences that I have learnt while working on MS sql server as a DBA. The blog is also updated frequently with the real world problem that I encounter hands on at work and the resolutions to resolve them. I hope this blog will be of some use to you and you will revisit. Thank you for stopping by and you are welcome to leave comments.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment