Understanding the SQL text feature

Adaptive Server Monitor can obtain the text of the currently executing SQL batch in each client connection to Adaptive Server. Viewing the SQL text of long-running batches helps you debug hung processes or fine-tune long statements that are heavy resource consumers.

To enable collection of SQL text, Adaptive Server must be configured to collect the text and write it to shared memory, where it is read by Monitor Server when Monitor Server clients request such data. The client requests might come from the Process Current SQL Statement Monitor in Sybase Central, Monitor Historical Server, or from other Monitor Client Library applications.

The max SQL text monitored Adaptive Server configuration parameter controls whether SQL batch text is collected and how much text is stored per client connection.

For each client connection, text of only the currently executing batch is available. The text of a new batch overwrites the text of previously executed batches. If the batch text is larger than the value of max SQL text monitored, the remainder is truncated.