Foxhound is the better* Database Monitor for SQL Anywhere.
*better: More thorough, more relevant, more effective.
...more Alerts, more All Clears, more details, more control in your hands.


[Home] [Table of Contents] [Previous Section] [Next Section]

Breck Carter
Last modified: February 12, 1998
mail to: bcarter@bcarter.com


Tip 77: Sybase SQL Anywhere
Performance Tips & Techniques


26 - Diagnose Problems With Runtime Properties

SQL Anywhere offers built-in functions that can retrieve three kinds of runtime statistics: Connection_Property() returns information related to a single connection, DB_Property() returns information about a single database, and Property() returns information about an engine as a whole. These functions provide more information than either SQL Central or the NT Performance Monitor because those facilities only display engine properties.

Figure 26A shows how ISQL can be used to call these functions. In this example the CommLink connection property names the protocol in use between DBCLIENT and DBSRV50, the ConnCount database property specifies how many connections to the database are in use, and the DiskRead and DiskWrite engine properties say how many actual I/O operations have been performed by the server.

Figure 26A - Runtime Properties Via ISQL

The property functions and the available property names are described in the Help file DBENG50W.HLP under "System Functions" as shown in Figure 26B.

Figure 26B - Runtime Properties Described In DBENG50W.HLP

Application programs can also retrieve these properties as shown in Figures 26C and 26D. This means you can write code that is self-diagnosing when it comes to some runtime performance problems. Since the Connection_Property() function defaults to returning information about "this connection" it is especially convenient for an application to make its own calls rather than use ISQL and try to figure out what the application's connection number is.

Figure 26C - Selecting Properties In PowerBuilder

string ls_CommLink

long ll_ConnCount, ll_DiskRead, ll_DiskWrite

SELECT connection_property ( 'CommLink' ) as CommLink,

db_property ( 'ConnCount' ) as ConnCount,

property ( 'DiskRead' ) as DiskRead,

property ( 'DiskWrite' ) as DiskWrite

INTO :ls_CommLink,

:ll_ConnCount,

:ll_DiskRead,

:ll_DiskWrite

FROM sys.dummy

USING SQLCA;

IF SQLCA.SQLCode <> 0 THEN

MessageBox ( "Error", "SELECT failed" )

RETURN

END IF

MessageBox ( "Properties", &

"CommLink:~t" + ls_CommLink + "~r~n" &

+ "ConnCount:~t" + string ( ll_ConnCount ) + "~r~n" &

+ "DiskRead:~t" + string ( ll_DiskRead ) + "~r~n" &

+ "DiskWrite:~t" + string ( ll_DiskWrite ) )

Figure 26D - Runtime Properties Via PowerBuilder


[Home] [Table of Contents] [Previous Section] [Next Section]