DBSPY 2.0

User's Guide


 


Contents

What is DBSPY *

Overview *

Getting Started *

Program Package *

System Requirements *

Installation Instructions *

How to run DBSPY *

Starting the Program *

Tracing Options *

What are Tracing Options? *

Opening the Tracing Options window *

Selecting processes for tracing *

Selecting tracing presentation *

Closing Tracing Options window *

Tracing Details *

File Operations *

New *

Saving trace to a file *

Opening trace from a file *

Edit Operations *

Copy *

Go to line *

Find *

Reports *

Toolbars and Windows *

Toolbars *

Windows *

Advanced Configuration *

Tracing Recommendations *

Overview *

Appendix A *

List of traced DBLIB functions *

Appendix B *

List of traced CTLIB functions *

Appendix C *

List of traced SYBDB functions *

Technical Support *

How to reach us *

 


What is DBSPY

Overview

When database client applications communicate with a database server they make API calls to a database client library (DCL) providing database communications API. For Microsoft SQL Server and Sybase SQL Server, up to release 4.9, this library was DBLIB. In Windows 3.1/3.11 DBLIB is the DLL named W3DBLIB.DLL. For Windows 95/Windows NT the DBLIB library name is NTWDBLIB.DLL. For Sybase SQL Server System 10 and 11 Sybase introduced 2 new client libraries: CTLIB and SYBDB. For CTLIB the name of the DLL for Windows 3.1/3.11 is WCTLIB.DLL, for Windows 95/Windows NT the DLL is LIBCTLIB.DLL. For SYBDB the respective names are WSYBDB.DLL and LIBSYBDB.DLL. SYBDB API is very similar to DBLIB API except for several function declarations.

Client applications make calls to DCL to communicate to a database. 3GL-written applications, such as "C" or "C++", usually make these calls explicitly(if not using database class libraries), while 4GL-written applications, such as written in Visual Basic or PowerBuilder, usually make these calls implicitly, through programming constructs provided by the 4GL. The task of tracing database calls the application is making becomes very important for:

 

 

For simple 3GL-written applications the tracing can be done by inserting tracing statements for every database call. If the 3GL application is very complex this strategy is usually not acceptable, as inserting tracing statements becomes a project by itself. For 4GL situations the situation is even worse as there usually is no access to the code that makes DCL calls.

DBSPY 2.0 provides a different opportunity to trace DCL calls without instrumenting the source code and therefore not requiring the availability of the source code. DBSPY can trace any function in all Sybase and MS SQL Server DCLs on Windows 3.1/3.11 or Windows NT 3.51/4.0 platforms. Trace information includes:

 

 

For 16-bit applications DBSPY 2.0 uses tracing technology described by James Finnegan in Microsoft Systems Journal (Vol. 9, No. 1) and implemented by him in PROCHOOK.DLL.

For 32-bit applications DBSPY 2.0 is based on the proprietary technology developed by Kogosoft Corporation.

Any information related to DBSPY should be directed to

Kogosoft Corporation:

P.O.Box 26

Carle Place NY 11514-0026

Phone: (888) 997-4155 (toll-free)

Email: info@kogosoft.com

Fax: (516) 338 - 5330


Getting Started

Program Package

 

The DBSPY 2.0 program package includes the following documentation and software:

 

 

 

System Requirements

The DBSPY 2.0 program requires the following minimum hardware and software configuration:

 

Note

DBSPY 2.0, 16-bit edition can also run as a 16 bit application under Windows 95 and Windows NT operating systems. In this case it has to run NOT in separate memory space and will trace calls from the 16-bit applications running NOT in separate memory space.

 

 

Installation Instructions

 

The installation procedure has to be used in order to install the program. You cannot simply copy the program files from the installation disk to your hard drive.

Insert the Installation Disk into a floppy drive.

From the MS Windows Program Manager or File Manager starts the SETUP.EXE program from your floppy drive (A: or B:).

Follow the installation instructions in your screen.

 

Notes:

    • If you install DBSPY 2.0, 16-bit edition AND DBSPY 2.0, 32-bit edition do not install them in the same directory. It will create conflicts between the 16-bit and 32-bit runtime components of the program.
    • DBSPY 2.0 uses PowerBuilder runtime DLLs, version 5.03. If you have PoweBuilder runtime DLLs(16 or 32 bit) already installed on your computer make sure that there is no conflict between the runtime libraries.

 


How to run DBSPY

Starting the Program

 

To start the program click on the DBSPY 2.0 icon:

You can also run the DBSPY16.EXE (for 16-bit edition) or DBSPY32.EXE (for 32-bit edition) from Program Manager or File Manager.

The start-up screen has one open empty sheet:

 

DBSPY 2.0 is an MDI application. Multiple tracing sheets can be opened at the same time. The active sheet will capture current database client API calls, database messages and errors.

 

Note:

The trace becomes active after Tracing Options are selected and at least one sheet window is open.

 

 

Tracing Options

What are Tracing Options?

For each client library (DBLIB, CTLIB, SYBDB) you can select a number of functions that you want to trace, tracing presentation attributes such as: application name, arguments, timing and logging. Also you will have to select process(es) (application(s)) that will be traced.

Note:

To turn the trace ON you will have to make the following selections:

Tracing options are set in the Tracing Options window. It contains tab folder with three tabs labeled DBLIB, CTLIB, and SYBDB representing the corresponding database client libraries. All tabs have similar layout.

 

 

Note:

 

Opening the Tracing Options window

 

From the Options menu, choose Tracing Options, or use the Sheet Toolbar button:

Tracing Options window will be displayed:

 

 

Selecting database library for tracing

To select database library for tracing click on the respective tab (DBLIB, CTLIB, and SYBDB) on the tab folder in the Tracing Options window.

 

Selecting functions for tracing

In order to select a function for tracing you have to move it from the ‘Available’ box to the ‘Selected’ box.

Selecting a function to trace can be done in several ways:

 

 

 

‘Drag and Drop’ Method

Drag a function from the left selection panel (‘Available’ box) and drop it into the right panel (‘selected’ box).

 

 

‘Move Selected’ Method

Select a function or a group of functions (extended selection using Shift or

Control Keys) and click on button.

 

‘Move All’ Method

Select all functions by clicking on button to move all functions from

Available’ box to ‘Selected’ box.

 

Unselecting functions

Unselecting functions is similar to selection, except that all transfers are from the right panel (‘selected’ box) to the left panel (‘Available’ box).

Example: To unselect all function(s) click on button.

 

 

 

Selecting processes for tracing

 

In order to select application(s) that will be traced you have to make a single or multiple selection in the list box: Processes located in the left bottom part of the Tracing Options screen.

 

 

Notes:

 

 

Selecting tracing presentation

 

To select presentation attributes for trace information use the box in the right-hand bottom part of the Tracing Options Screen. It lets you specify whether API call arguments, application name from which the call has been made, return code and execution time for the call should be presented in the trace view. You can also specify if and where the tracing information should be logged.

Note:

These settings affect only the visible presentation of the trace in the main tracing window. For detail information on the traced call, logging and file operations all trace attributes are used.

Arguments

To show arguments in the main tracing window click on ‘Arguments’ check box.

Timing

To show function execution time (seconds) in the main tracing window click on ‘Timing ‘check box.

Application Name

To show Application Name in the main tracing window click on ‘Application Name’ check box.

Logging to File

To set up the ‘Log file’ tracing window click on ‘Log to file’ check box. It will allow you to type the name of the file directly into edit line box or use the ‘Browse’ button to open the standard ‘Select File’ dialog window.

Notes:

 

 

Closing Tracing Options window

 

You can close the Tracing Options window by clicking on the "OK" or "Cancel" buttons.

If "Cancel" button is clicked all current selections made in Tracing Options window will be lost.

If "OK" button is clicked tracing selections will be stored in the program configuration file and will be effective for the current and following sessions. Process selection information will be saved for current session only.

 

 

Tracing Details

 

To get detail information on any trace row in any sheet window – double-click on it.

This will display Trace Detail Window:

 

You can keep this window open. Double clicking on another row will refresh it.

 

File Operations

File operations of DBSPY 2.0 are straightforward. You can open New sheet window, Save or Log a trace and later Open it again in the application.

New

 

Multiple tracing sheets can be opened at the same time in DBSPY 2.0.

To open New trace sheet window from File menu, choose New or use the Frame Toolbar button:


An empty sheet window will be displayed:

 

 

Saving trace to a file

 

Saving trace to a file is functionally similar to logging to a file. The only difference is that logging will do it one line at a time while saving takes all data from the active sheet window.

 

To save any Trace sheet window to a file:

It will open standard window Save as dialog where you can choose the directory and type the name of the file.

 

Note:

When saving to a file with an intent to open it in DBSPY in the future (example: to run a report) make sure that the format is "Text" (not "Text with headers"). For exporting to other applications the following formats are supported: HTML, EXCEL, CSV, DBASE.

 

 

 

Opening trace from a file

 

Any valid ‘TXT’ file saved from available in DBSPY 2.0 application options such as ‘Logging to a file’, ‘Saving trace to a file ’ can be opened into a new tracing sheet window.

To open a previously saved file into a new sheet window from the File menu, choose Open or press Ctrl + O keys or use or use the Frame Toolbar button:

 

It will open standard window dialog where you can choose the directory and the file

 

 

Note:

This new window opened from a file becomes a valid trace window with all functions available in DBSPY 2.0 such as Report, Details and etc.

 

Edit Operations

Copy

 

To copy any line from a Tracing window to the Clipboard

 


Go to line

 

To go to any line within active Tracing window you can use ‘Go to line‘ dialog window.

To activate it choose ‘Go to line… ‘ from the Edit menu or press Ctrl + G keys or use the Sheet Toolbar button:

It will display ‘Go to line’ window.

 

 

Find

 

To find text within active Tracing window you can use ‘Find ‘ dialog window.

To activate it choose ‘Find…’ from the Edit menu or press Ctrl + F keys or use the Sheet Toolbar button:

It will display ‘Find Text ’ window.

 

 

Note:

‘Find Next ’ button will be enabled after first occurrence of the text is found.

 

Reports

 

After tracing is completed you can generate the API performance report.

From the Reports menu, choose API Performance Report or use the Sheet Toolbar button (if visible).

API Performance Report window will be displayed.

The report will be generated for the current MDI sheet.

The generated report can be sorted by any column: Function, Count, Average Time, Minimum Time, and Maximum Time. In order to do it - click on the column header. Additional click will toggle the sort order for the column.

 

 

 

If you keep the Report window opened and switch to another trace sheet window you can simply get the API Performance Report for the window by pressing Refresh button.

The timing and count pie - charts on the report window can be maximized and later restored to original size.

 

 

 

Toolbars and Windows

Toolbars

 

DBSPY 2.0 has two toolbars (Frame Bar, Sheet Bar) which can be used for quick access to many main features. The Sheet Bar will be available if at least one sheet is open.

You can show, hide, move toolbars and /or show text, tips on the toolbar.

 

To show, hide or move toolbar

 

Click right button the background of the Frame Bar toolbar to open standard windows toolbar menu setup or from the File menu, choose Toolbars.

 

It displays the Toolbars dialog box

 

In order to configure the toolbar you should:

 

 

The toolbars contain the following buttons:

 

Frame Bar

 

Sheet Bar

 

 

Windows

 

Multiple tracing sheets can be opened at the same time during the session of DBSPY 2.0 .To see all open windows (sheets) choose one of the options in Window Menu:

 

 

 

Note:

The Tile command resizes and arranges the open group windows side by side. The Cascade command resizes and layers the open group windows so that each title bar is visible.

 

 

Advanced Configuration

 

DBSPY uses a configuration file - DBSPY.INI to store tracing options information for all database client libraries: DBLIB, CTLIB, SYBDB. Each library section has similar structure. Below is an example of a library section:

 

[DBLIB Options]

Functions = dbclose; dberrhandle; dbinit;dblogin; dbmsghandle;dbnextrow;

Time = 0

Return Cod = 0

Argument = 0

Function Name = 0

Log = 0

Log Name =

Function Color =

Message1 Color =

Message2 Color =

Trace On Start =0

 

Note:

It is recommended not to change this setting manually except Function Color, Message1 Color, Message2 Color which allow you to have an impression of rich text format and make information more readable

 

Default colors will be used if no values are specified.

To change the default colors provide the values you want using the following formula (known as the RGB): 65536*Blue + 256*Green+Red where Blue, Green and Red take values from 0 to 255.

 


Tracing Recommendations

Overview

The following tracing recommendations may prove to be useful for database client debugging:

 

 

 

 

 

 


Appendix A

List of traced DBLIB functions

 

abort_xact

bcp_batch

bcp_bind

bcp_colfmt

bcp_collen

bcp_colptr

bcp_columns

bcp_control

bcp_done

bcp_exec

bcp_init

bcp_moretext

bcp_readfmt

bcp_sendrow

bcp_setl

bcp_writefmt

build_xact_string

close_commit

commit_xact

db__getdbTimeout

dbabsolute

dbadata

dbadlen

dbaltbind

dbaltcolid

dbaltlen

dbaltop

dbalttype

dbaltutype

dbanullbind

dbbind

dbbylist

dbcancel

dbcanquery

dbchange

dbclose

dbclrbuf

dbclropt

dbcmd

dbcmdrow

dbcolbrowse

dbcollen

dbcolname

dbcolsource

dbcoltype

dbcolutype

dbconvert

dbcount

dbcurcmd

 

dbcurrow

dbcursor

dbcursorbind

dbcursorclose

dbcursorcolinfo

dbcursorfetch

dbcursorinfo

dbcursoropen

dbdata

dbdataready

dbdatecrack

dbdatlen

dbdead

dberrhandle

dbexit

dbfcmd

dbfirstrow

dbfreebuf

dbfreelogin

dbfreequal

dbgetchar

dbgetmaxprocs

dbgetoff

dbgetrow

dbgettime

dbgetuserdata

dbhasretstat

dbinit

dbisavail

dbiscount

dbisopt

dblastrow

dblocklib

dblogin

dbloginfree

dbmorecmds

dbmoretext

dbmsghandle

dbname

dbnextrow

dbnullbind

dbnumalts

dbnumcols

dbnumcompute

dbnumorders

dbnumrets

dbopen

dbordercol

dbprhead

 

dbprrow

dbprtype

dbqual

dbreadpage

dbreadtext

dbresults

dbretdata

dbretlen

dbretname

dbretstatus

dbrettype

dbrows

dbrowtype

dbrpcinit

dbrpcparam

dbrpcsend

dbrpwclr

dbrpwset

dbsetavail

dbsetlname

dbsetlogintime

dbsetmaxprocs

dbsetnull

dbsetopt

dbsettime

dbsetuserdata

dbsqlexec

dbsqlok

dbsqlsend

dbstrcpy

dbstrlen

dbtabbrowse

dbtabcount

dbtabname

dbtabsource

dbtslen

dbtsnewlen

dbtsnewval

dbtsput

dbtsval

dbtxptr

dbtxtimestamp

dbtxtnewval

dbtxtsput

dbtxtsval

dbunlocklib

dbuse

dbvarylen

dbwillconvert

 

 

dbwinexit

dbwritepage

dbwritetext

open_commit

remove_xact

scan_xact

start_xact

stat_xact


Appendix B

List of traced CTLIB functions

 

ct_bind

ct_br_column

ct_br_table

ct_callback

ct_cancel

ct_capability

ct_close

ct_cmd_alloc

ct_cmd_drop

ct_cmd_props

ct_command

ct_compute_info

ct_con_alloc

ct_con_drop

ct_con_props

ct_config

ct_connect

ct_cursor

ct_data_info

ct_describe

ct_diag

ct_dynamic

ct_dyndesc

ct_exit

ct_fetch

ct_get_data

ct_getformat

ct_getloginfo

ct_init

ct_keydata

ct_options

ct_param

ct_poll

ct_recvpassthru

ct_labels

ct_remote_pwd

ct_res_info

ct_results

ct_send

ct_send_data

ct_sendpassthru

ct_setloginfo

ct_wakeup

 


Appendix C

List of traced SYBDB functions

 

 

abort_xact

bcp_batch

bcp_bind

bcp_colfmt

bcp_collen

bcp_colptr

bcp_columns

bcp_control

bcp_done

bcp_exec

bcp_init

bcp_moretext

bcp_readfmt

bcp_sendrow

bcp_writefmt

build_xact_string

close_commit

commit_xact

db__getdbTimeout

dbadata

dbadlen

dbaltbind

dbaltcolid

dbaltlen

dbaltop

dbalttype

dbaltutype

dbanullbind

dbbind

dbbylist

dbcancel

dbcanquery

dbchange

dbclose

dbclrbuf

dbcmd

dbcmdrow

dbcolbrowse

dbcollen

dbcolname

dbcolsource

dbcoltype

dbcolutype

dbconvert

dbcount

dbcurcmd

dbcurrow

 

dbcursor

dbcursorbind

dbcursorclose

dbcursorcolinfo

dbcursorfetch

dbcursorinfo

dbcursoropen

dbdata

dbdatecrack

dbdatlen

dbdead

dberrhandle

dbexit

dbfcmd

dbfirstrow

dbfreebuf

dbfreequal

dbgetchar

dbgetmaxprocs

dbgetoff

dbgetrow

dbgetuserdata

dbhasretstat

dbinit

dbisavail

dbisopt

dblastrow

dblogin

dbloginfree

dbmorecmds

dbmoretext

dbmsghandle

dbname

dbnextrow

dbnullbind

dbnumalts

dbnumcols

dbnumcompute

dbnumorders

dbnumrets

dbopen

dbordercol

dbprtype

dbqual

dbreadpage

dbreadtext

dbresults

 

dbretdata

dbretlen

dbretname

dbretstatus

dbrettype

dbrows

dbrowtype

dbrpcinit

dbrpcparam

dbrpcsend

dbrpwclr

dbsetavail

dbsetlname

dbsetlogintime

dbsetmaxprocs

dbsetnull

dbsettime

dbsetuserdata

dbsqlexec

dbsqlok

dbsqlsend

dbstrcpy

dbstrlen

dbtabbrowse

dbtabcount

dbtabname

dbtabsource

dbtsnewlen

dbtsnewval

dbtsput

dbtxptr

dbtxtimestamp

dbtxtnewval

dbtxtsput

dbuse

dbvarylen

dbwillconvert

dbwritepage

dbwritetext

open_commit

remove_xact

start_xact

stat_xact

 

 

 


Technical Support

How to reach us

For technical support please contact Kogosoft Corporation:

E-mail: info@kogosoft.com

Web: www.kogosoft.com

 



| Home Page | Screen Shot | DBSPY 2.0 | Download Demo|


Copyright © 1997, Kogosoft Corporation. All Rights Reserved.