SQL Azure仅在sys.dm_exec_sessions中返回一行 [英] SQL Azure only returning one row in sys.dm_exec_sessions

查看:54
本文介绍了SQL Azure仅在sys.dm_exec_sessions中返回一行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在本地Microsoft SQL Server中,当我发出以下查询时:

In on-premises Microsoft SQL Server, when I issue this query:

选择*来自sys.dm_exec_sessions

SELECT * FROM sys.dm_exec_sessions

我在SSMS中每个窗口获得一条记录.如果在SSMS中打开多个查询窗口,即使它们没有执行任何操作,我也会获得每个记录的记录.在Azure中,当我发出相同的查询时,我只会得到一条记录.这很重要-当我在Azure中活跃工作的SSMS中有多个窗口时,我什至只获得一条记录.

I get one record per window in SSMS. If I open several query windows in SSMS, I get a record for each of those, even if they're not doing anything. In Azure, when I issue that same query, I only get one record back. Here's the kicker - I even only get one record back when I've got multiple windows in SSMS doing active work in Azure.

以下是屏幕截图:

SQL Azure http://s3temp.brentozar.com/azure1.png

在该屏幕截图中,我在SSMS中拥有三个活动选项卡.其中两个正在运行巨大的插入语句,这些语句需要花费几秒钟的时间来执行,而第三个正在查询sys.dm_exec_sessions-但我只获得了一条记录.我在sys.dm_tran_active_transactions和sys.dm_tran_database_transactions中获得了多个记录,但是,如果我不能将其绑定到各个会话,这将改变我报告活动查询的方式.这是预期的行为,还是MS正在Azure vNext中修复该问题?

In that screenshot, I've got three active tabs in SSMS. Two of them are running giant insert statements that take several seconds to execute, and the third one is querying sys.dm_exec_sessions - but I'm only getting one record back. I get multiple records in sys.dm_tran_active_transactions and sys.dm_tran_database_transactions, but this changes how I report on active queries if I can't tie it back to individual sessions. Is that expected behavior, or something MS is working to fix in Azure vNext?

推荐答案

在Microsoft内部将其升级后,他们同意sys.dm_exec_sessions中存在错误.它的过滤方式不正确,因此无论您的权限如何,它始终只显示您当前的会话,而不会显示其他会话.他们将在将来的SQL Azure版本中对其进行更新.

After escalating this inside Microsoft, they've agreed that there's a bug in sys.dm_exec_sessions. It's improperly filtered, so it always shows just your current session and no other sessions regardless of your permissions. They'll update it in a future release of SQL Azure.

如果需要证明,请在MSDN线程中获取更多信息:

More info in the MSDN thread if you need proof:

http://social.msdn.microsoft.com/Forums/zh-CN/ssdsgetstarted/thread/db88c830-0b0a-4e38-ad93-062d12d55c31

这篇关于SQL Azure仅在sys.dm_exec_sessions中返回一行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆