The SNAPSUBSECTION administrative view and the SNAP_GET_SUBSECTION table function return information about application subsections, namely the subsection logical monitor grouping.
This administrative view allows you to retrieve subsection logical monitor group snapshot information for the currently connected database.
Used with the SNAPAGENT, SNAPAGENT_MEMORY_POOL, SNAPAPPL, SNAPAPPL_INFO and SNAPSTMT administrative views, the SNAPSUBSECTION administrative view provides information equivalent to the GET SNAPSHOT FOR APPLICATIONS on database-alias CLP command, but retrieves data from all database members.
The schema is SYSIBMADM.
Refer to Table 1 for a complete list of information that can be returned.
In a non-restrictive database, SELECT privilege is granted to PUBLIC when the view is automatically created.
SELECT DB_NAME, STMT_TEXT, SS_STATUS, DBPARTITIONNUM
FROM SYSIBMADM.SNAPSUBSECTION
ORDER BY DB_NAME, SS_STATUS, DBPARTITIONNUM
DB_NAME STMT_TEXT SS_STATUS DBPARTITIONNUM
-------...- ----------------------...- ---------...- --------------
SAMPLE select * from EMPLOYEE EXEC 0
SAMPLE select * from EMPLOYEE EXEC 1
The SNAP_GET_SUBSECTION table function returns the same information as the SNAPSUBSECTION administrative view, but allows you to retrieve the information for a specific database on a specific database member, aggregate of all database members or all database members.
Refer to Table 1 for a complete list of information that can be returned.
Used with the SNAP_GET_AGENT, SNAP_GET_AGENT_MEMORY_POOL, SNAP_GET_APPL, SNAP_GET_APPL_INFO and SNAP_GET_STMT table functions, the SNAP_GET_SUBSECTION table function provides information equivalent to the GET SNAPSHOT FOR ALL APPLICATIONS CLP command, but retrieves data from all database members.
>>-SNAP_GET_SUBSECTION--(--dbname--+----------+--)------------->< '-, member-'
The schema is SYSPROC.
If both dbname and member are set to NULL, an attempt is made to read data from the file created by SNAP_WRITE_FILE procedure. Note that this file could have been created at any time, which means that the data might not be current. If a file with the corresponding snapshot API request type does not exist, then the SNAP_GET_SUBSECTION table function takes a snapshot for the currently connected database and database member number.
In a non-restrictive database, EXECUTE privilege is granted to PUBLIC when the function is automatically created.
SELECT DB_NAME, STMT_TEXT, SS_STATUS, DBPARTITIONNUM
FROM TABLE(SYSPROC.SNAP_GET_SUBSECTION( '', 0 )) as T
ORDER BY DB_NAME, SS_STATUS, DBPARTITIONNUM
DB_NAME STMT_TEXT SS_STATUS DBPARTITIONNUM
-------...- ----------------------...- ---------...- --------------
SAMPLE select * from EMPLOYEE EXEC 0
SAMPLE select * from EMPLOYEE EXEC 1
Column name | Data type | Description or corresponding monitor element |
---|---|---|
SNAPSHOT_TIMESTAMP | TIMESTAMP | The date and time that the snapshot was taken. |
DB_NAME | VARCHAR(128) | db_name - Database name |
STMT_TEXT | CLOB(16 M) | stmt_text - SQL statement text |
SS_EXEC_TIME | BIGINT | ss_exec_time - Subsection execution elapsed time |
TQ_TOT_SEND_SPILLS | BIGINT | tq_tot_send_spills - Total number of table queue buffers overflowed |
TQ_CUR_SEND_SPILLS | BIGINT | tq_cur_send_spills - Current number of table queue buffers overflowed |
TQ_MAX_SEND_SPILLS | BIGINT | tq_max_send_spills - Maximum number of table queue buffers overflows |
TQ_ROWS_READ | BIGINT | tq_rows_read - Number of rows read from table queues |
TQ_ROWS_WRITTEN | BIGINT | tq_rows_written - Number of rows written to table queues |
ROWS_READ | BIGINT | rows_read - Rows read |
ROWS_WRITTEN | BIGINT | rows_written - Rows written |
SS_USR_CPU_TIME_S | BIGINT | ss_usr_cpu_time - User CPU time used by subsection (in seconds)* |
SS_USR_CPU_TIME_MS | BIGINT | ss_usr_cpu_time - User CPU time used by subsection (fractional, in microseconds)* |
SS_SYS_CPU_TIME_S | BIGINT | ss_sys_cpu_time - System CPU time used by subsection (in seconds)* |
SS_SYS_CPU_TIME_MS | BIGINT | ss_sys_cpu_time - System CPU time used by subsection (fractional, in microseconds)* |
SS_NUMBER | INTEGER | ss_number - Subsection number |
SS_STATUS | VARCHAR(20) | ss_status - Subsection status . This interface
returns a text identifier based on defines in sqlmon.h and is one of:
|
SS_NODE_NUMBER | SMALLINT | ss_node_number - Subsection node number |
TQ_NODE_WAITED_FOR | SMALLINT | tq_node_waited_for - Waited for node on a table queue |
TQ_WAIT_FOR_ANY | INTEGER | tq_wait_for_any - Waiting for any node to send on a table queue |
TQ_ID_WAITING_ON | INTEGER | tq_id_waiting_on - Waited on node on a table queue |
DBPARTITIONNUM | SMALLINT | dbpartitionnum - Database partition number monitor element |
MEMBER | SMALLINT | member - Database member monitor element |
* To calculate the total time spent for the monitor element that this column is based on, you must add the full seconds reported in the column for this monitor element that ends with _S to the fractional seconds reported in the column for this monitor element that ends with _MS, using the following formula: (monitor-element-name_S × 1,000,000 + monitor-element-name_MS) ÷ 1,000,000. For example, (ELAPSED_EXEC_TIME_S × 1,000,000 + ELAPSED_EXEC_TIME_MS) ÷ 1,000,000. |