the situation is that there are certain stored procedures and/or ad-hoc SQL that is causing our CPU to spike from 30 to 80% and dropping all our indexes out of memory, I’m wondering if there is a well established way to correlate the performance spikes (CPU, Disk Read, etc.) to particular instances of SP running..
the situation is that there are certain stored procedures and/or ad-hoc SQL that is
Share
Performance Monitor. If Sql Server 2008 –> Start, Program Files, Microsoft Sql Server 2008, Performance Tools, Sql Server Profiler. Produces a trace. Trace contains all sorts of information. For instance, with a bit of work, one could find the begin and end trace events of a stored procedure, note that the time that it was running covered the spikes, then further verify by looking @ the resource counters collected by the trace. Try this link over at sql server performance: http://www.sql-server-performance.com/articles/per/correlate_trace_performance_p1.aspx
Use Alerts in SQL Server Agent to fire off custom T-SQL which captures what is running @ that particular time. Sql Server Agent, Alerts, General, new alert, Type = SQL Server Performance condition alert ( setup as you wish ), Response, Execute job. The job has a sql script which writes to a table – telling you what was happening. All sorts of worlds could be your oyster. For instance, you could ask yourself – hey, what clr is in memory right now?
What’s in memory right now?