如何检查 ODBC 通信,以查看正在传递的 SQL?

发布于 2024-08-13 12:42:27 字数 54 浏览 1 评论 0原文

是否有适用于 Windows 的工具可用于检查通过特定 ODBC 数据源的任何 SQL 命令?

Is there a tool for windows that we can use to inspect any SQL commands that go through a particular ODBC data source?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

十二 2024-08-20 12:42:27

您可以让 ODBC 注销它正在执行的所有操作:

当您从“跟踪”选项卡开始跟踪时,驱动程序管理器将记录所有随后运行的应用程序的所有 ODBC 函数调用。不会记录在跟踪启动之前运行的应用程序的 ODBC 函数调用。

  • 如有必要,请使用具有本地管理员组成员身份的帐户登录。
  • 从管理工具中,打开 ODBC 数据源管理器。
  • 点击“跟踪”选项卡。
  • 使用“机器范围内跟踪所有用户身份”复选框配置跟踪模式:
  • 要启用计算机范围的跟踪,请选中该复选框。
  • 要返回到每用户跟踪,请清除该复选框。
  • 点击“应用”。

http://msdn.microsoft.com /en-us/library/ms711020%28VS.85%29.aspx

请注意:

当您从“跟踪”选项卡开始跟踪时,驱动程序管理器将记录所有随后运行的应用程序的所有 ODBC 函数调用。不会记录在跟踪启动之前运行的应用程序的 ODBC 函数调用。

您还可以通过编程方式执行此操作:

...可以通过调用SQLSetConnectAttr 并将连接中的SQL_ATTR_TRACE 属性设置为SQL_OPT_TRACE_ON 来完成此操作。因此,通过执行此操作,您将在连接持续时间内启用/禁用它。

http://decipherinfosys.wordpress.com/2009/01/ 17/odbc-tracing/

You can make ODBC log out everything it's doing:

When you start tracing from the Tracing tab, the Driver Manager will log all ODBC function calls for all subsequently run applications. ODBC function calls from applications that are running before tracing is started are not logged.

  • If it is necessary, log on using an account that has membership in the Local Administrators' group.
  • From Administrative Tools, open the ODBC Data Source Administrator.
  • Click the Tracing tab.
  • Configure the tracing mode using the Machine-Wide tracing for all user identities check box:
  • To enable machine-wide tracing, select the check box.
  • To return to per-user tracing, clear the check box.
  • Click Apply.

http://msdn.microsoft.com/en-us/library/ms711020%28VS.85%29.aspx

Note that:

When you start tracing from the Tracing tab, the Driver Manager will log all ODBC function calls for all subsequently run applications. ODBC function calls from applications that are running before tracing is started are not logged.

You can also do it programmatically:

... One can do this by calling SQLSetConnectAttr and set the SQL_ATTR_TRACE attribute in the connection to SQL_OPT_TRACE_ON. So, by doing this you would be enabling/disabling it for the connection duration.

http://decipherinfosys.wordpress.com/2009/01/17/odbc-tracing/

电影里的梦 2024-08-20 12:42:27

如果您使用的是 SQL Server,请查看 SQL Server Profiler。 Profiler 允许您监视/跟踪您的应用程序和 SQL Server 之间的所有通信,包括调用了哪些过程、参数值等,而无需修改您的应用程序。

如果您使用不同的服务器,您应该能够找到可以执行相同操作的 sql 代理。

If you're using SQL Server, look at the SQL Server Profiler. Profiler allows you to monitor/trace all communications between your application and the SQL Server, including which procedures are called, parameter values, etc, without having to modify your application.

If you're using a different server, you should be able to find a sql proxy that will do the same thing.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文