Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.
Returns a summary of request timing information for all connections when the database server has request timing logging enabled.
|Column name||Data type||Description|
Returns the connection ID (a number) for the current connection.
Returns the name of the current connection.
You can specify a connection name using the ConnectionName (CON) connection parameter.
The following names are used for temporary connections created by the database server:
Returns the user ID for the connection.
Returns the ID number of the database.
Returns the date and time the connection was established. This value is affected by simulated time zone.
Returns the date and time the database was first modified after a COMMIT or ROLLBACK, or an empty string if no modifications have been made to the database since the last COMMIT or ROLLBACK. This value is affected by simulated time zone.
Returns the date and time at which the last request for the specified connection started. This column can contain null for internal connections, such as events. This value is affected by simulated time zone.
Returns the type of the last request. If a connection has been cached by connection pooling, its ReqType value is CONNECT_POOL_CACHE.
Returns the status of the request. It can be one of the following values:
The values marked with an asterisk (*) are only returned when logging of request timing information has been turned on for the database server using the -zt server option. If request timing information is not being logged (the default), the values are reported as Executing.
Returns the amount of unscheduled time, or NULL if the -zt option was not specified.
Returns the amount of time, in seconds, spent processing requests, or NULL if the -zt option was not specified.
Returns the amount of time, in seconds, spent waiting for I/O to complete, or NULL if the -zt option was not specified.
Returns the amount of time, in seconds, spent waiting for a lock, or NULL if the -zt option was not specified.
Returns the amount of time, in seconds, spent waiting for atomic access, or NULL if the RequestTiming server property is set to Off.
Returns the number of times the connection waited for scheduling, or NULL if the -zt option was not specified.
Returns the number of requests processed, or NULL if the RequestTiming server property is set to Off.
Returns the number of times the connection waited for I/O to complete, or NULL if the -zt option was not specified.
Returns the number of times the connection waited for a lock, or NULL if the -zt option was not specified.
Returns the number of times the connection waited for atomic access, or NULL if the -zt option was not specified.
Returns the number of ticks between requests.
Returns zero if the current connection isn't blocked, or if it is blocked, the connection number on which the connection is blocked because of a locking conflict.
Returns the number of uncommitted operations.
Returns the name of the procedure that a connection is currently executing. If the connection is executing nested procedure calls, the name is the name of the current procedure. If there is no procedure executing, an empty string is returned.
Returns the name of the associated event if the connection is running an event handler. Otherwise, an empty string is returned.
Returns the current line number of the procedure or compound statement a connection is executing. The procedure can be identified using the CurrentProcedure property. If the line is part of a compound statement from the client, an empty string is returned.
Returns the most recently prepared SQL statement for the current connection.
The LastStatement value is set when a statement is prepared, and is cleared when a statement is dropped. Only one statement string is remembered for each connection.
If sa_conn_activity reports a non-empty value for a connection, it is most likely the statement that the connection is currently executing. If the statement had completed, it would likely have been dropped and the property value would have been cleared. If an application prepares multiple statements and retains their statement handles, then the LastStatement value does not reflect what a connection is currently doing.
When client statement caching is enabled, and a cached statement is reused, this property returns an empty string.
Returns the long text plan of the last query executed on the connection. You control the remembering of the last plan by setting the RememberLastPlan option of the sa_server_option system procedure, or using the -zp server option.
Returns information about the client that made the connection. For HTTP connections, this includes information about the browser. For connections using older versions of jConnect or SAP Open Client, the information may be incomplete.
Returns the number of locks held by the connection.
Returns the number of snapshots associated with the connection.
The sa_performance_diagnostics system procedure returns a result set consisting of a set of request timing properties and statistics if the server has been told to collect the information. Recording of request timing information must be turned on the database server before calling sa_performance_diagnostics. To do this, specify the -zt option when starting the database server or execute the following:
CALL sa_server_option( 'RequestTiming','ON' );
You must have EXECUTE privilege on the system procedure, as well as the MONITOR system privilege.
Find all requests that are currently executing, and have been executing for more than 60 seconds:
SELECT Number, Name, CAST( DATEDIFF( second, LastReqTime, CURRENT TIMESTAMP ) AS DOUBLE ) AS ReqTime FROM sa_performance_diagnostics() WHERE ReqStatus <> 'IDLE' AND ReqTime > 60.0 ORDER BY ReqTime DESC;