DB2 Version 9.7 for Linux, UNIX, and Windows

SNAPSHOT_SWITCHES table function

Returns information about the database snapshot switch state.

Read syntax diagramSkip visual syntax diagram
>>-SNAPSHOT_SWITCHES--(--dbpartitionnum--)---------------------><

The schema is SYSPROC.

Table function parameter

dbpartitionnum
An input argument of type INTEGER that specifies a valid database partition number. Specify -1 for the current database partition, or -2 for all active database partitions. An active database partition is a partition where the database is available for connection and use by applications.

If the null value is specified, -1 is set implicitly.

Authorization

One of the following authorities is required to execute the function:
  • EXECUTE privilege on the function
  • DATAACCESS authority
To access snapshot monitor data, one of the following authorities is required:
  • SYSMON authority
  • SYSCTRL authority
  • SYSMAINT authority
  • SYSADM authority

The function returns a table as shown in the following section.

Table 1. Information returned by the SNAPSHOT_SWITCHES table function
Column name Data type Description or corresponding monitor element
SNAPSHOT_TIMESTAMP TIMESTAMP snapshot_timestamp - Snapshot timestamp
UOW_SW_STATE SMALLINT State of the unit of work monitor recording switch (0 or 1).
UOW_SW_TIME TIMESTAMP If the unit of work monitor recording switch is on, the date and time that this switch was turned on.
STATEMENT_SW_STATE SMALLINT State of the SQL statement monitor recording switch (0 or 1).
STATEMENT_SW_TIME TIMESTAMP If the SQL statement monitor recording switch is on, the date and time that this switch was turned on.
TABLE_SW_STATE SMALLINT State of the table activity monitor recording switch (0 or 1).
TABLE_SW_TIME TIMESTAMP If the table activity monitor recording switch is on, the date and time that this switch was turned on.
BUFFPOOL_SW_STATE SMALLINT State of the buffer pool activity monitor recording switch (0 or 1).
BUFFPOOL_SW_TIME TIMESTAMP If the buffer pool activity monitor recording switch is on, the date and time that this switch was turned on.
LOCK_SW_STATE SMALLINT State of the lock monitor recording switch (0 or 1).
LOCK_SW_TIME TIMESTAMP If the lock monitor recording switch is on, the date and time that this switch was turned on.
SORT_SW_STATE SMALLINT State of the sorting monitor recording switch (0 or 1).
SORT_SW_TIME TIMESTAMP If the sorting monitor recording switch is on, the date and time that this switch was turned on.
PARTITION_NUMBER SMALLINT node_number - Node number