Using Transact-SQL to monitor performance

Providing monitoring information as tables enables you to use Transact-SQL to monitor Adaptive Server. For example, to identify the processes that have consumed the greatest CPU time or logical I/Os, use:

select SPID, Login = suser_name(ServerUserID), CPUTime, LogicalReads 
from master..monProcessActivity
order by CPUTime desc

You can use the same query to find the processes that are using the most physical I/O by substituting PhysicalReads for CPUTime.

The information in each monitoring table can be sorted, selected, joined, inserted into another table, and treated much the same as the information in a regular Adaptive Server table.

The monitoring tables are read-only and do not allow updates because they are in-memory tables that are generated as they are queried. Additionally, you cannot create triggers on monitoring tables.

You can use access control commands such as grant and revoke select to restrict access to the monitoring tables.

The monitoring tables definitions use the Component Integration Services (CIS) proxy table feature, which allows Adaptive Server to define remote procedures as local tables.