I do not see a standard report where we can specify a machine and return top SQL statements. Does anyone have a report or raw SQL for that? I am on DPA version 12.
Thank you,
David kranes
David,
I assume you mean within a monitored instance, you would like to specify one of the machine names listed in the Machines tab and get a list of Top SQLs. Here is a script that should get you started and you can run it from Management Studio while connected to the DPA repository database.
Notes:
Before running this script, change the following as needed:
DECLARE @DBID varchar(5), @SQL varchar(1000);
SELECT @DBID = ID FROM ignite.COND WHERE NAME = 'AVANTIS'; -- substitute the instance name here
SET @SQL = 'SELECT m.NAME AS [Machine], st.ST AS [SQL Text], sum(sw.QP)/100 as [WaitSeconds]
FROM ignite.CONSW_'+@DBID+' sw
INNER JOIN ignite.CONM_'+@DBID+' m ON m.ID = sw.PWMY
INNER JOIN ignite.CONST_'+@DBID+' st ON st.H = sw.IZHO
WHERE sw.D BETWEEN ''11/01/2018'' AND ''11/28/2018'' -- change date values as needed
AND m.NAME like ''DRICHARDS%'' -- change the machine name as needed
GROUP BY m.NAME, st.ST
ORDER BY [WaitSeconds] DESC';
EXEC (@SQL)
SolarWinds solutions are rooted in our deep connection to our user base in the THWACK® online community. More than 195,000 members are here to solve problems, share technology and best practices, and directly contribute to our product development process.