简体   繁体   English

在 SQL Server 中,如何捕获所有外部事务?

[英]In SQL Server, how do I capture all external transactions?

My management has asked me to create a new SSRS Report , that will show how many calls to my SQL Server 2016 .我的管理层要求我创建一个新的SSRS 报告,该报告将显示对我的 SQL Server 2016 的调用次数。 They want to know:他们想知道:

  1. How many external transactions were called to each database?每个数据库调用了多少外部事务?
  2. What is the daily count of the external calls?每天的外部呼叫数是多少?
  3. What was the longest (slowest) external transaction?最长(最慢)的外部事务是什么?

Note, they do Not want to see how many internal SQL transactions are happening.请注意,他们不想看到发生了多少内部SQL 事务。

As a clarification, say you have a website that calls data from SQL Server.作为澄清,假设您有一个从 SQL Server 调用数据的网站。 he wants to know when the web server makes a call to the SQL Server, then when the SQL Server responded.他想知道 Web 服务器何时调用 SQL Server,然后 SQL Server 何时响应。 This is what is being called an external transaction.这就是所谓的外部交易。 We have maybe a dozen different app servers that I need to capture this data from.我们可能有十几个不同的应用服务器,我需要从中捕获这些数据。

Check out the SQL Server Profiler.查看 SQL Server Profiler。 You can set it to run against specific usernames, assuming these external logins have distinct usernames it should be able to give you everything you wish.您可以将其设置为针对特定用户名运行,假设这些外部登录具有不同的用户名,它应该能够为您提供所需的一切。

https://docs.microsoft.com/en-us/sql/tools/sql-server-profiler/sql-server-profiler?view=sql-server-ver15 https://docs.microsoft.com/en-us/sql/tools/sql-server-profiler/sql-server-profiler?view=sql-server-ver15

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM