SQL Client Profiler? [英] SQL Client Profiler?

查看:94
本文介绍了SQL Client Profiler?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道" SQL Server Profiler ",但是是否有任何工具或方法可用来监视从客户端计算机发出的sql查询?

I am aware of "SQL Server Profiler", But is there any tools or methods available to monitor the issued sql queries from the client machine?

我目前想到的一些事情是:

Some of the things currently in my mind are:

1)SysInternals ProcMon可以记录并告知客户端计算机上的可执行进程何时连接到sql server.有没有其他类似但更高级的工具可以告诉更多数据?

1) The SysInternals ProcMon can log and tell when the executable process on client machine connects to sql server. Any similar but more advanced tools available to tell more data?

2)客户端计算机可使用的客户端库和API的任何调试版本或检测版本允许该操作吗?

2) Any debug version or instrumented version of client libraries and APIs available for client machine to allow such operation?

推荐答案

您可以从ODBC数据源管理器(odbcad32.exe)启用ODBC跟踪.它生成的日志文件相当神秘,但是它将为您提供由该计算机上已登录用户运行的SQL语句.还有一个标记为针对所有用户身份的机器范围跟踪"的复选框,用于记录该计算机上任何用户(包括服务)运行的所有SQL语句.

You can enable ODBC Tracing from the ODBC Data Source Administrator (odbcad32.exe). The log file it generates is rather cryptic but it will provide you with the SQL statements run by the logged in user on that machine. There is also a checkbox labeled "Machine-Wide tracing for all user identities" for logging all SQL statements run by any user - including services - on that machine.

在断开连接并重新连接到SQL Server之前,可能无法开始记录.因此,最好重新启动连接到SQL Server的所有程序/服务.如果启用了连接池,这一点尤其重要,即使有问题的程序已断开连接,连接池也将保持打开状态.

Logging may not start until you disconnect and reconnect to the SQL server. So, it is a good idea to restart whatever programs/services connect to your SQL Server. This is especially important if you have connection pooling enabled, which will keep connections open even if the program, in question, has disconnected.

此外,在Windows 64位上有两个版本的ODBC数据源管理器,一个用于32位,另一个用于64位.因此,您将需要为要跟踪的程序的适当位数启用日志记录.

Also, there are two versions of the ODBC Data Source Administrator on Windows 64bit, one for 32bit and the other for 64bit. So, you will need to enable logging for the appropriate bitness of the program you are tracing.

  • How To Generate an ODBC Trace with ODBC Data Source Administrator
  • Setting Tracing Options
  • Why my 32 bit applications cannot see the ODBC DSNs that I created on my 64 bit machine ?
  • ODBC Administrator tool displays both the 32-bit and the 64-bit user DSNs in a 64-bit version of Windows

更新:您的另一种选择是使用 Wireshark .由于它具有坐在网络驱动程序级别的能力,因此它可以拦截您的所有网络流量-包括但不限于SQL.这些称为 TDS数据包- FreeTDS (带有

Update: Another option for you would be to use a tool like Wireshark. Since it has the ability to sit at the network driver level, it can intercept all your network traffic - including but not limited to SQL. These are known as TDS packets - a standard that is used by Sybase SQL Server (ASE), Microsoft SQL Server and FreeTDS ( w/ UnixODBC).

  • RPR NA03: Analysing SQL Server performance using Wireshark and Excel
  • How do I filter SQL Server traffic between app and DB servers using Wireshark?
  • How can I decode SQL Server traffic with wireshark?
  • What does my SQL Server data look like over the wire?
  • Google Search for "Wireshark+SQL"

这篇关于SQL Client Profiler?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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