{"id":664,"date":"2012-01-01T23:10:00","date_gmt":"2012-01-01T22:10:00","guid":{"rendered":"http:\/\/sburke.eu\/blog\/?p=664"},"modified":"2022-07-25T23:27:40","modified_gmt":"2022-07-25T22:27:40","slug":"sql-activity-monitor-debug-high-cpu-usage-for-sql-server","status":"publish","type":"post","link":"http:\/\/sburke.eu\/blog\/2012\/01\/sql-activity-monitor-debug-high-cpu-usage-for-sql-server\/","title":{"rendered":"SQL Activity Monitor &#8211; Debug high CPU Usage for SQL Server"},"content":{"rendered":"\n<p>START -&gt; All Programs -&gt; Microsoft SQL Server 2008 R2 -&gt; SQL Server Management Studio<\/p>\n\n\n\n<p>Connect as normal and right-click on the SQL Server (top left) and go &#8220;Activity Monitor&#8221;.<\/p>\n\n\n\n<p>The Activity Monitor will show the queries been run, the user, the computer been run from etc. This can help narrow down clients chewing up the SQL Database and\/or show the databases and queries causing the most issues.<\/p>\n\n\n\n<p>You can also right-click on a Process listed (by a user\/computer) and go &#8220;Kill Process&#8221; to end the SQL client connection (useful if you want to force a user to logout of sql to free up a client license etc.).<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" width=\"1024\" height=\"535\" src=\"http:\/\/sburke.eu\/blog\/wp-content\/uploads\/2022\/07\/sql-activity-monitor-1024x535-1.gif\" alt=\"\" class=\"wp-image-666\" title=\"sql-activity-monitor\"\/><\/figure><\/div>\n\n\n<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br>Problem:<br>When I tried to launch the Activity Monitor on a Windows 7 x64 client, I got the error below:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">The Activity Monitor is unable to execute queries against Server. Activity Monitor for this instance will be placed into a paused state.\nUnable to&nbsp; find SQL Server process ID on server (Microsoft.SqlServer.Management.ResourceMonitoring)<\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\">Solution:\ncd \\windows\\system32\nlodctr \/R<\/pre>\n\n\n\n<p>Ref (<a href=\"http:\/\/serverfault.com\/questions\/141849\/activity-monitor-is-unable-to-execute-queries-against-server\" target=\"_blank\" rel=\"noreferrer noopener\">#<\/a>).<\/p>\n\n\n\n<h2>Alternative to Activity Monitor<\/h2>\n\n\n\n<p>Run the following queries:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">#Stored Procedure for showing who is connected.\nsp_who2;\n\n#In the SPID column you can see the Session ID of the User. You can go kill spidno to kill that query.\nkill SPIDNo.\n\n#Stored Procedure for showing locks.\nsp_lock;<\/pre>\n\n\n\n<p>Ref (<a href=\"http:\/\/www.simple-talk.com\/sql\/database-administration\/the-dba-as-detective-troubleshooting-locking-and-blocking\/\" target=\"_blank\" rel=\"noreferrer noopener\">#<\/a>).<\/p>\n","protected":false},"excerpt":{"rendered":"<p>START -&gt; All Programs -&gt; Microsoft SQL Server 2008 R2 -&gt; SQL Server Management Studio Connect as normal and right-click on the SQL Server (top left) and go &#8220;Activity Monitor&#8221;. The Activity Monitor will show the queries been run, the &hellip; <a href=\"http:\/\/sburke.eu\/blog\/2012\/01\/sql-activity-monitor-debug-high-cpu-usage-for-sql-server\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[3],"tags":[59],"_links":{"self":[{"href":"http:\/\/sburke.eu\/blog\/wp-json\/wp\/v2\/posts\/664"}],"collection":[{"href":"http:\/\/sburke.eu\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/sburke.eu\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/sburke.eu\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/sburke.eu\/blog\/wp-json\/wp\/v2\/comments?post=664"}],"version-history":[{"count":2,"href":"http:\/\/sburke.eu\/blog\/wp-json\/wp\/v2\/posts\/664\/revisions"}],"predecessor-version":[{"id":667,"href":"http:\/\/sburke.eu\/blog\/wp-json\/wp\/v2\/posts\/664\/revisions\/667"}],"wp:attachment":[{"href":"http:\/\/sburke.eu\/blog\/wp-json\/wp\/v2\/media?parent=664"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/sburke.eu\/blog\/wp-json\/wp\/v2\/categories?post=664"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/sburke.eu\/blog\/wp-json\/wp\/v2\/tags?post=664"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}