sp_monitor enhancements

In Adaptive Server® Enterprise 15.x, the stored procedure sp_monitor has been enhanced to support deadlock and procstack monitoring types. For syntax information about these parameters, see “System changes for sp_monitor”.

To summarize these enhancements:

Enable and disable

The enable/disable options in sp_monitor have been enhanced to provide a greater level of granularity, including an argument that allows you to selectively enable or disable a specific monitoring type, and thus to set or unset the configuration options required by the specific monitoring type.

The default behavior is that all the monitoring types supported by sp_monitor are turned either on or off. Most configuration options required to support the monitoring types are also enabled or disabled.

If you do use enable or disable to specify an entity type, monitoring is enabled or disabled for only that particular entity, and the configuration options required for only that entity are turned ON or OFF.

deadlock

sp_monitor enhancements can fetch data from the monDeadLock table and present it to the user in a human-readable format. Sites that can neither turn on the configuration option print deadlock information, nor alter their applications to turn the deadlock traces on, can capture deadlock events directly from the monitoring table. Users can instead monitor deadlocks using sp_monitor, and use the results to tune and troubleshoot the areas of their applications that cause deadlocks.

You can use these features of this enhancement to:

NoteThese features are supported whether the deadlock analysis is performed directly on the monitoring table or on data archived in an archive table.

procstack

sp_monitor procstack examines the execution of a task within a nested stored procedure execution. The procedures executed are extracted by retrieving data from the monProcessProcedures table at runtime.

sp_monitor procstack lets you monitor connections by generating a SQL text fragment for each executing procedure, and a backtrace for a task that might, for example, be waiting for a lock while executing a deeply nested stored procedure sequence.

procstack generates a summary for the sequence of stored procedures executed, and calls sp_helptext to extract a SQL context block around the line number of each procedure’s execution frame. If possible, the execution plan of the currently executed statement in the procedure is generated.

sp_monitor procstack can help you identify, during application development, errors that lead to blocking; during production, this interface regenerates inefficient SQL code at the moment performance slows down, or tasks are blocked.

list

list provides a snapshot of the monitoring enabled in the server, and of the configuration options required for the enabled monitoring entities. Any configuration options that are missing, but required by the enabled monitoring entities, are also listed. Configuration options that are already enabled, through either sp_configure or the configuration file, are also noted in the list output.

archive and report

archive and report commands display monitoring data for a specified monitoring type. These commands specify the location of the archive table.

For example:

sp_monitor archive, 'deadlock'
sp_monitor report, 'deadlock'
	sp_monitor 'archive [using prefix=<string>]', {'<monitoring type>'}
	sp_monitor 'report [using prefix=<string>]', '<monitoring type>'
          [,<options supported for monitoring_type>]

To report deadlock event data from a default archive table, monDeadLock, in the current database, mondb, enter:

sp_monitor report, 'deadlock'
sp_monitor 'archive [using prefix=<string>]', {'<monitoring type>'}

Usage :

NoteCurrently, archiving and reporting are supported only for deadlock monitoring data from monDeadLock.

help

This command produces enhanced command-specific help and usage information for sp_monitor.