-
Notifications
You must be signed in to change notification settings - Fork 55
Collect a SQL Driver BID Trace
Malcolm Stewart edited this page Dec 17, 2020
·
54 revisions
The built-in diagnostic trace outputs the state of various driver APIs. This is a very detailed trace that can reveal information about issues that the driver may encounter. The trace records the process and thread ID to keep various activities separate, as well as a timestamp accurate to the system timer resolution (about 100ns).
An ODBC trace is performed by the ODBC Driver Manager, a shim DLL between the application and the driver. This DLL acts as a proxy, and as such, intercepts all driver calls and can log the ODBC API state of any ODBC driver.
This trace has a number of major disadvantages over BID traces:
- It is very slow and can significantly impact application performance.
- It is very difficult to configure to trace server applications.
- It only traces the high-level API between the application and the driver and shows no internal driver state.
- Almost all Windows-based data access components, including ADO, JDBC XA Transactions, and managed providers.
- SQL Servers up through SQL 2014. SQL 2016 and later can be traced via XEvent SNI tracing.
- SQL Server ODBC Drivers for Linux (special instructions apply).
- The Microsoft JDBC Driver. See https://docs.microsoft.com/en-us/sql/connect/jdbc/tracing-driver-operation?view=sql-server-ver15
- .NET Core System.Data and Microsoft.Data libraries.
- Non-Microsoft drivers and Providers. These often have their own trace functionality.