Can I see all the SQL statements sent over an ODBC connection?

I am working with a third-party application that uses ODBC to connect and modify the database. In certain failure modes, the end results are not what I expect. To understand this better, I would like to somehow check all the applications sent to the database. Is there a way to do this with ODBC?

I know that with JDBC I could use http://www.p6spy.com/ to see all the instructions sent, for example, when debugging sleep mode. p6spy is a proxy driver that records the commands sent and forwarded to the real JDBC driver.

Another option might be a protocol sniffer that will capture posting statements. Although, I'm not sure if ODBC includes a standard wired protocol or only specifies an API.

Does anyone know of existing tools that would allow me to do this? Alternatively, is there any other approach I could take?

+4
source share
3 answers

ODBC indicates how your program interacts with the local driver, not how the local driver interacts with the remote database. Your proxy driver idea sounds, you just need to find it.

+1
source

Have you tried the trace built into ODBC? The ODBC Data Source Administrator has a trace tab. As far as I remember, the information collected is rather verbose.

+1
source

I think it is easier to read the logs on the SQL side, regardless of the database. For example, turning on a monitor on SQL Server or viewing logs in MySQL. It seems that using a sniffer will be more of a problem than it's worth, but I think it depends on the tools available. What DBMS do you use?

0
source

Source: https://habr.com/ru/post/1307405/


All Articles