Mimer SQL Documentation TOC PREV NEXT INDEX

Mimer SQL Developer Site


ODBC Trace


Mimer ODBC Trace is a tool for getting the details out of an ODBC session. It can for example be used for debugging, monitoring and analyzing purposes. For each ODBC statement the tool can trace:

This software consists of two parts, the Mimer ODBC Trace Administration tool and the Mimer ODBC Trace DLL that substitutes the standard Microsoft ODBC Trace DLL.

The administration tool has two main functions:

To use the Mimer ODBC Trace DLL, it must first be activated using the administration tool.

Before using this software however, you should read Important Notes.

Using the Administration Tool

When starting the administration tool, the following dialog is displayed.



The Configuration Part

The left side of the window is the Configuration part, which is used to change the settings for the logging.

The two list boxes are used to manage which functions calls are to be logged, and which are not. Calls to functions present in the left list box will not be logged, and calls to functions present in the right list box will be logged.

The Enable>> button moves any selected function(s) in the left list box over to the right, thus activating logging of calls to that/those function(s).

The <<Disable button moves any selected function(s) in the right list box over to the left, thus deactivating logging of calls to that/those function(s).

The Log file Path edit field is where you specify the location of the generated log file(s). The path must exist for logging to be conducted successfully.

The radio button Mimer ODBC Trace specifies that the Mimer ODBC Trace DLL should be used instead of the default Microsoft ODBC Trace DLL. There is also a radio button Microsoft ODBC Trace, which can be used to switch back. See also Important Notes.

The Apply button saves any changes to the fields described above.

The Cancel button dismisses the dialog without saving any changes you have made and that are not applied.

The OK button save any changes you might have made, and dismisses the dialog.

Start Logging

After pressing the Start Tracing Now button (renames to Stop Tracing Now), logging will take effect for all applications attaching to the DLL. As the settings only will be read when the DLL is loaded, already started applications will not be affected.

Each started application will have a log file of its own, placed in the location specified by Log file Path and named mimodbctrac-applname-mmdd-hhmm.xml.

Stop Logging

Pressing the Stop Tracing Now button (renames to Start Tracing Now) means that no logging will take place for applications started afterwards.

Note: Already running applications will continue logging until they quit. When an application ends, its log file is closed and becomes available for presentation.

The Presentation Part

The right side of the main window is the Presentation part (as showed below). It is used to present results from a selected log file, that has been produced by the Mimer ODBC Trace DLL.



First of all you have to find a Mimer ODBC Trace log file by using the button Select Logfile. Then you get a new window Select Log File, where you should choose a file, which is named according to the output from the DLL, i.e. mimodbctrac-applname-mmdd-hhmm.xml. When selected the name will be displayed in the field XML Logfile.

Next a presentation form should be selected from the XSL files menu. When a XSL file is selected the Display button should be pressed and the presentation will be shown.

Presentation Formats

Currently there are 3 different predefined presentations:

odbclog.xsl

Shows all information from the log file. Functions, which used more time than 0.01 seconds are displayed with the time in red color.

sqlstm.xsl

Shows all SQL statements found in the log file.

timgt1hs.xsl

Shows all functions, which used more time than 0.01 seconds.

Example odbclog.xsl:

Timestamp
Function
UsedTime
(sec)
Application (Processid:Threadid)
Handle [id]
Return code
SQL-statement
2003-12-11 15:28:29.60
SQLAllocStmt
0.0001
wsql
(fff60ad9 :fff49a99)
HDBC[0x028f0280]
SQL_SUCCESS

2003-12-11 15:28:29.93
SQLPrepare
0.2296
wsql
(fff60ad9 :fff49a99)
HSTMT[ 0x028f0acc]
SQL_SUCCESS
select P from JSP

Example sqlstm.xsl:

SQL-statements
SELECT DISTINCT P FROM SPJ, S, J WHERE SPJ.S = S.S AND SPJ.J = J.J AND S.CITY = J.CITY

Example timgt1hs.xsl:

Timestamp
Function
UsedTime
(sec)
SQL-statement
2003-12-11 15:28:29.93
SQLPrepare
0.1675
SELECT DISTINCT P FROM SPJ, S, J WHERE SPJ.S = S.S AND SPJ.J = J.J AND S.CITY = J.CITY

Customized Presentations

Additional XSL files can be added to the default XSL file location.

The distributed XSL files may, for example, be modified, and replaced or stored as a new XSL file in the same location. Maybe other time limits are desired, or other colors, or others.

If for example, other time limits are wanted, the distributed XSL files may be modified and replaced or stored as a new XSL file in the same location.

Important Notes


Mimer
Mimer Information Technology AB
Voice: +46 18 780 92 00
Fax: +46 18 780 92 40
info@mimer.se
Mimer SQL Documentation TOC PREV NEXT INDEX