Database Administrators
Q&A for database professionals who wish to improve their database skills
Latest Questions
3
votes
1
answers
8856
views
Permanent count of waiting tasks (2) in Activity monitor
Now I'm observing in Activity Monitor permanent count of waiting tasks: ![enter image description here][1] and at "Resource waits" tab I see next: ![enter image description here][2] so, my question is: **How to find and resolve this wait tasks?** I suspect that it related with transactional replicat...
Now I'm observing in Activity Monitor permanent count of waiting tasks:
and at "Resource waits" tab I see next:
so, my question is: **How to find and resolve this wait tasks?**
I suspect that it related with transactional replication, which running on the server. This wait tasks I see only on Distributor. This issues appeared after restarting SQL server service.
sp_whoisactive - doesn't show any locks.
Thanks a lot for any information.


whitebeast
(169 rep)
Jun 5, 2015, 01:57 PM
• Last activity: Jul 17, 2025, 05:10 AM
3
votes
2
answers
4249
views
Activity Monitor % Processor Time grayed out on SQL Server
The *% Processor Time* graph at *Activity Monitor* for remote connections stopped working and it grayed out after the physical SQL Server restart (image below), but when I get in the server with the same Domain User it works fine. It was also working fine on remote connections before the restart and...
The *% Processor Time* graph at *Activity Monitor* for remote connections stopped working and it grayed out after the physical SQL Server restart (image below), but when I get in the server with the same Domain User it works fine. It was also working fine on remote connections before the restart and I have noticed that it takes significantly more time to load the Processes than before.
The problem is happening to all users that try to see the Processor Time remotely including **sa** and server admins so I would think it´s not a permission issue. The server runs Windows Server 2012 and SQL Server 2012.
What could be happening? or How can I solve this?
Thanks in advance! and sorry about my English.

Server Demon
(41 rep)
Jul 28, 2016, 04:33 PM
• Last activity: Dec 27, 2024, 10:02 AM
1
votes
1
answers
1575
views
Activity Monitor Blocked by Firewall. Set Static Port?
We are seeing an issue with not being able to open Activity monitor for remote SQL servers. The Activity Monitor is unable to execute queries against server . Activity Monitor for this instance will be placed into a paused state. Use the context menu in the overview pane to resume the Activity Monit...
We are seeing an issue with not being able to open Activity monitor for remote SQL servers.
The Activity Monitor is unable to execute queries against server .
Activity Monitor for this instance will be placed into a paused state.
Use the context menu in the overview pane to resume the Activity Monitor.
The RPC server is unavailable. (Exception from HRESULT: 0x800706BA) (mscorlib)
It appears some firewall is blocking it,
When we look at firewall logs (on the network), we are seeing blocks from 496xx. And its different port for each server.
Is anyone aware if we can make this a static port?

user191716
(11 rep)
Sep 25, 2019, 08:03 PM
• Last activity: Dec 27, 2024, 09:55 AM
0
votes
1
answers
131
views
% processor Time in Activity monitor is greyed out
When I connect to my SQL Server using SQL Server Management Studio (SSMS) from a remote computer, the "% Processor Time" metric in the Activity Monitor is greyed out and unavailable. However, when I connect to the same server from SSMS installed on the local machine (where the SQL Server instance is...
When I connect to my SQL Server using SQL Server Management Studio (SSMS) from a remote computer, the "% Processor Time" metric in the Activity Monitor is greyed out and unavailable. However, when I connect to the same server from SSMS installed on the local machine (where the SQL Server instance is running), the "% Processor Time" metric is visible and functioning as expected. Is this the normal behaviour of Activity monitor , If yes please provide proof for this
RD Seeker
(35 rep)
Dec 27, 2024, 09:38 AM
• Last activity: Dec 27, 2024, 09:53 AM
0
votes
2
answers
9467
views
Active Expensive Queries and Recent Expensive Queries Meaning
I am trying to understand the active expensive queries and recent expensive queries in Activity Monitor. What is expensive means here? Does it means expensive in term of cpu, block, memory, reads?
I am trying to understand the active expensive queries and recent expensive queries in Activity Monitor. What is expensive means here? Does it means expensive in term of cpu, block, memory, reads?
Imran Qadir Baksh - Baloch
(1319 rep)
Nov 15, 2020, 12:02 PM
• Last activity: Oct 17, 2024, 03:51 PM
0
votes
1
answers
88
views
Track the connection history to a certain table in SQL Server
Is there a way to keep the connection history to a certain table in SQL-server? Not just the database because that's easy using the DMV's but just one particular table.
Is there a way to keep the connection history to a certain table in SQL-server?
Not just the database because that's easy using the DMV's but just one particular table.
chittybang
(151 rep)
Sep 9, 2024, 09:54 AM
• Last activity: Sep 10, 2024, 03:40 AM
0
votes
1
answers
130
views
Activity Monitor duplicates in recent expensive query
I have this strange issue on one of my DB (SQL Server 2016) in which the activity monitor display duplicates entries in recent expensive query. [![enter image description here][1]][1] [1]: https://i.sstatic.net/mHqOK.png In the picture above you can see a snapshot (only two lines) of the Activity Mo...
I have this strange issue on one of my DB (SQL Server 2016) in which the activity monitor display duplicates entries in recent expensive query.
In the picture above you can see a snapshot (only two lines) of the Activity Monitor, that display two indentical query (same query text, same execution plan, same target DB) as it was two distinct queries instead of grouping them and incrementing the field execution/min.
What is happening here? it's just an Activity Monitor glitch or should i start to check what's wrong in my DB. I am afraid that the same ORM query (executed two times by differnt request) is not recognized by DB as the same query, and istead it's considered as two different queries, that will degrading performance.

Skary
(368 rep)
Jul 3, 2023, 12:46 PM
• Last activity: Sep 18, 2023, 10:21 PM
2
votes
1
answers
10626
views
Activity Monitor paused
Some of our end-users still like to use the Activity Monitor in SQL Server. When setting up our SQL-server 2016 servers the activity monitor always ends up in a paused state when the users are not part of the "Administrators" group in Windows (on the server). When the users are part of the Administr...
Some of our end-users still like to use the Activity Monitor in SQL Server.
When setting up our SQL-server 2016 servers the activity monitor always ends up in a paused state when the users are not part of the "Administrators" group in Windows (on the server).
When the users are part of the Administrator-group all data gets through (so probably not a Firewall-problem).
We also tried:
- Adding the users to the "Performance Monitor Users" and "Distributed COM Users"
- In COM: Changing the limits of "My Computer" and the permissions on "Windows Management and Instrumentation".
- The users also have the "View server state" permission in SQL Server.
Do you have any other suggestions?
Kind Regards,
Tim
chittybang
(151 rep)
Apr 2, 2020, 02:39 PM
• Last activity: Apr 8, 2022, 08:45 AM
7
votes
3
answers
688
views
Check server activity with code
I would like to see the activity on of the SQL server. So I can run a query when the server load is low. I know there is an activity monitor in SQL server but my company doesn't want me to give the rights to use this tool. Apparently you can kill other people queries and this is too dangerous. Is th...
I would like to see the activity on of the SQL server. So I can run a query when the server load is low. I know there is an activity monitor in SQL server but my company doesn't want me to give the rights to use this tool. Apparently you can kill other people queries and this is too dangerous.
Is there a way to check the status of the server with code?
(Or view the activity without needing those rights so I can manually run them?)
Freddy
(173 rep)
May 28, 2013, 09:19 AM
• Last activity: Mar 14, 2022, 09:01 AM
2
votes
1
answers
1578
views
Executions/min and CPI ms/sec inside Activity Monitor is too high
We have executions/min is too high, around 20,000 to 30,000 for a query. Does this means the query is executing 20,000 per minute? I don't think we have that much load on server that a single query runs 20,000 per minute. Also, I am always confused with CPU ms/sec. Does this means total CPU used per...
We have executions/min is too high, around 20,000 to 30,000 for a query. Does this means the query is executing 20,000 per minute? I don't think we have that much load on server that a single query runs 20,000 per minute.
Also, I am always confused with CPU ms/sec. Does this means total CPU used per second? If yes how come we have lot of queries with 1000+ CPU ms/sec as we have limited CPU on server.
Imran Qadir Baksh - Baloch
(1319 rep)
Feb 25, 2021, 08:08 AM
• Last activity: Mar 7, 2021, 07:21 AM
0
votes
2
answers
590
views
Monitoring blocking queries in SQL Server 2012
have to monitor blocking queries in SQL Server 2012. How do we figure out which queries are the locked ones? Do I use the Activity Monitor? I want actual SQL statements.
have to monitor blocking queries in SQL Server 2012. How do we figure out which queries are the locked ones? Do I use the Activity Monitor? I want actual SQL statements.
cdub
(103 rep)
Jan 16, 2018, 06:31 PM
• Last activity: May 13, 2020, 06:55 PM
4
votes
2
answers
7881
views
Users running expensive queries
I am currently monitoring the expensive queries from the activity monitor for SQL server. How do I see who is running the different queries?
I am currently monitoring the expensive queries from the activity monitor for SQL server.
How do I see who is running the different queries?
user5495269
(305 rep)
Jan 25, 2016, 06:46 PM
• Last activity: May 13, 2020, 06:52 PM
2
votes
1
answers
90
views
How is Activity Monitor Pulling processes specific memory information?
How is SQL Server Management Studio's Activity Monitor pulling the following memory by processes information? The screen I am talking about is... Log into the database, right click on the server in the tree on the left and select activity monitor. Expand out processes. The Memory Use column - where...
How is SQL Server Management Studio's Activity Monitor pulling the following memory by processes information?
The screen I am talking about is...
Log into the database, right click on the server in the tree on the left and select activity monitor.
Expand out processes.
The Memory Use column - where is it coming? Is there an internal database table that it is pulling from?
I ask because I am trying to figure what all goes into this metric so I can determine if one of the processes is growing without bound or growing as expected due to design.
Philip
(137 rep)
May 24, 2016, 07:58 PM
• Last activity: May 13, 2020, 06:50 PM
8
votes
1
answers
1057
views
.NET executes a SQL query and Active Monitor shows multiple rows blocking each other
I use .NET to execute SQL operations on SQL Server 2014, here's the code used: ``` lang-cs using(SqlConnection conn = new SqlConnection(connectionString)){ //https://stackoverflow.com/questions/1880471/capture-stored-procedure-print-output-in-net conn.InfoMessage += new SqlInfoMessageEventHandler(lo...
I use .NET to execute SQL operations on SQL Server 2014, here's the code used:
lang-cs
using(SqlConnection conn = new SqlConnection(connectionString)){
//https://stackoverflow.com/questions/1880471/capture-stored-procedure-print-output-in-net
conn.InfoMessage += new SqlInfoMessageEventHandler(logSqlMessages);
conn.Open();
using(SqlCommand stmt = new SqlCommand{
Connection = conn,
CommandText = sql,
CommandTimeout = 30000 // The time in seconds to wait for the command to execute. The default is 30 seconds.
//,CommandType = CommandType.StoredProcedure
})
{
affectedRecords = stmt.ExecuteNonQuery();
} // using stmt
} // using conn
When I look at Active Monitor, there are tens of rows referencing the same operation. They all have the same session_id
, some of them have Task State running and most of them are suspended. Some of them have LastWaitTime CXPACKET
and most are PAGEIOLATCH_SH
.
I also ran a query on SQL Server and same behavior happened on Active Monitor.
Maybe it's a normal behavior of it, but it's odd that a SELECT operation creates multiple rows and blocks itself like that. Any idea of what may be causing it?
Hikari
(1603 rep)
Jun 19, 2019, 01:43 PM
• Last activity: Jun 20, 2019, 09:23 AM
10
votes
3
answers
39282
views
How to get the SQL Server Activity Monitor's output using T-SQL?
Is there any script to get the output just like Activity Monitor? Or Which DMV's can I use to get the output as Activity Monitor displays on the screen? It should be able to display the stored procedure name as well as the statement from the stored procedure which is currently running and the blokin...
Is there any script to get the output just like Activity Monitor?
Or
Which DMV's can I use to get the output as Activity Monitor displays on the screen?
It should be able to display the stored procedure name as well as the statement from the stored procedure which is currently running and the bloking related info as well.
user118167
Feb 22, 2017, 07:57 AM
• Last activity: Apr 30, 2019, 08:03 PM
4
votes
1
answers
1580
views
SQL Server 2014 View any Live execution plan in Activity Monitor
I have a SQL Server 2014 Build(12.0.5205.0) running here. Would It be possible to view any Live execution plan (from queries being executed by other users) in Activity Monitor ? My problem is: When I open the Activity Monitor - > Active Expensive Queries, I can see all expensive queries, but clickin...
I have a SQL Server 2014 Build(12.0.5205.0) running here.
Would It be possible to view any Live execution plan (from queries being executed by other users) in Activity Monitor ?
My problem is:
When I open the Activity Monitor - > Active Expensive Queries, I can see all expensive queries, but clicking right button the "Show Live execution Plan" is only enabled for queries that my user is running, for the any other user this menu is disabled:
An example:
I heard about Trace flags, enable a global trace flag using [DBCC traceon(7412,-1)](http://www.sqlservercentral.com/blogs/matthew-mcgiffen-dba/2017/02/23/sql-server-2016-the-coolest-new-feature-live-query-stats/) .
So, my questions is:
1. Enabling This flag above (7412), considering the build version of my Sql Server, will it work? Or only in SQL Server 2016?
2. If it works, I don't have the sa rights. What kind of permissions do I have to ask for?

ricardo347
Feb 5, 2019, 02:00 PM
• Last activity: Feb 5, 2019, 08:24 PM
2
votes
3
answers
1225
views
SQL Query to find the location of the running query?
I am trying to get the information about the running queries for query performance monitoring purpose. Is there a way to get the location of the running query in SQL-server? For instance, if I have a stored procedure running in a server and if I'm getting all the activity monitoring data for the run...
I am trying to get the information about the running queries for query performance monitoring purpose.
Is there a way to get the location of the running query in SQL-server?
For instance, if I have a stored procedure running in a server and if I'm getting all the activity monitoring data for the running query, I want to fetch the path of the stored procedure in which the query is running.
Is there a query to do this or any other way to get this path?
Example Path/hierarchy :
sever/db/stored_procedure_name/query
Arav
(21 rep)
Aug 29, 2018, 01:37 PM
• Last activity: Nov 11, 2018, 09:59 PM
6
votes
2
answers
1980
views
Why is the processor % different in Activity Monitor vs Resource Monitor?
I'm tracking a significant difference between the processor % reported in the Activity Monitor for SQL Server vs the total processor % used in the Resource Monitor. I'm seeing about a 50% difference between the two with the Activity Monitor always being higher. System Specs: * SQL Server EE 2008 R2...
I'm tracking a significant difference between the processor % reported in the Activity Monitor for SQL Server vs the total processor % used in the Resource Monitor. I'm seeing about a 50% difference between the two with the Activity Monitor always being higher.
System Specs:
* SQL Server EE 2008 R2
* Windows 2008 R2
* Bare metal
* 96 cores w/no processor affinity set (4 Physical Sockets with 12 cores each w/HyperThreading enabled)
* 768 GB of memory
* Active/Passive cluster
* Direct attach storage of SSDs
What would cause such a difference?
Which one should I be looking at?
Update:
I see that resource monitor has it split between different categories however wouldn't the "CPU - Total" graph show all CPU usage on the machine?
The Task Manager Performance tab is showing the same difference between it and Activity Monitor.
* Activity Monitor is on a 1 sec refresh.
Could there be an issue with Activity Monitor not seeing that each core is HyperThreaded? Not sure how as SQL Server sees all 96 cores.
**Update 6/28/2018**
Even after migrating to AWS and updating the OS to Server 2012 R2 the SQL Server 2008 r2 Activity Monitor is still dramatically off from what Task Manager shows. The below screen shot is from a load test that was just performed. There is a visible 20% difference between the two metrics. Even when Task Manager is reporting the overall CPU just over 55% the SQL Activity Monitor is pegged at 100%. Metrics from the AWS Cloud watch show the same results as Task Manager so I have two data metrics that correlate with a third that isn't even in the ballpark.
Updated System Specs:
System Specs:
* SQL Server EE 2008 R2
* Windows 2012 Datacenter R2
* i3.16xl - Dedicated Host
* 64 cores w/no processor affinity set (2 Sockets with 32 cores each)
* 488 GB of memory
* Synchronous Mirroring
* ENA Enabled w/EBS Optimization enabled





Aaron
(1802 rep)
Sep 3, 2016, 01:53 AM
• Last activity: Jun 29, 2018, 12:55 AM
1
votes
1
answers
215
views
Does using Activity Monitor have an effect on server performance?
Our SQL Server VLDB is being monitored by Activity Monitor on a networked machine. 95% of all traced statements can be attributed to this tool, but is it known to have a negative effect on server/network?
Our SQL Server VLDB is being monitored by Activity Monitor on a networked machine.
95% of all traced statements can be attributed to this tool, but is it known to have a negative effect on server/network?
cloudsafe
(305 rep)
Feb 22, 2018, 04:42 PM
• Last activity: Feb 22, 2018, 04:47 PM
1
votes
1
answers
4989
views
Activity Monitor (SSMS) timeout error on Sql server instance
**Environment:** Window server 2012R2: RAM = 4GB Sql Server 2008R2: Min server memory = 0MB Max server memory = 2147483647MB **Background of problem:** I am managing database of asp.net application and recently application started to crash (when user tried to sign-in to the application; user see tim...
**Environment:**
Window server 2012R2: RAM = 4GB
Sql Server 2008R2: Min server memory = 0MB Max server memory = 2147483647MB
**Background of problem:**
I am managing database of asp.net application and recently application started to crash (when user tried to sign-in to the application; user see timeout exception on the browser).
In order to rectify the issue I set **timeout =1000** in connection string of webconfig file and that resolved the issue.
When application was crashing I tried to turn on the activity monitor on Sql server instance but I coudn't start activity monitor and got following error:
**My finding so far:**
I started my quest and troubleshooted and found that there is memory pressure but I need expert advice if there is any link of activity monitor not starting with memory pressure? I know error is from database as Sql server was busy at the time of crash. How I can further troubleshoot the problem?


shaadi
(47 rep)
Aug 23, 2017, 02:33 AM
• Last activity: Aug 24, 2017, 12:27 AM
Showing page 1 of 20 total questions