DB2 Version 9.7 for Linux, UNIX, and Windows

SNAP_GET_DBM table function - Retrieve the dbm logical grouping snapshot information

The SNAP_GET_DBM table function returns the snapshot monitor DB2® database manager (dbm) logical grouping information.

Used with the SNAP_GET_DBM_MEMORY_POOL, SNAP_GET_FCM, SNAP_GET_FCM_PART and SNAP_GET_SWITCHES table functions, the SNAP_GET_DBM table function provides the data equivalent to the GET SNAPSHOT FOR DBM command.

Refer to Table 1 for a complete list of information that can be returned.

Syntax

Read syntax diagramSkip visual syntax diagram
>>-SNAP_GET_DBM--(--+----------------+--)----------------------><
                    '-dbpartitionnum-'      

The schema is SYSPROC.

Table function parameter

dbpartitionnum
An optional input argument of type INTEGER that specifies a valid database partition number. Specify -1 for the current database partition, or -2 for an aggregate of all active database partitions. If this input option is not used, data will be returned from all active database partitions. An active database partition is a partition where the database is available for connection and use by applications.

If dbpartitionnum is 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_DBM table function calls the snapshot from memory.

Authorization

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

Example

Retrieve the start time and current status of database partition number 2.
SELECT DB2START_TIME, DB2_STATUS FROM TABLE(SNAP_GET_DBM(2)) AS T
The following example is a sample output from this query.
DB2START_TIME              DB2_STATUS 
-------------------------- ------------
2006-01-06-14.59.59.062798 ACTIVE 

Information returned

Table 1. Information returned by the SNAP_GET_DBM table function
Column name Data type Description or corresponding monitor element
SNAPSHOT_TIMESTAMP TIMESTAMP snapshot_timestamp - Snapshot timestamp monitor element
SORT_HEAP_ALLOCATED BIGINT sort_heap_allocated - Total sort heap allocated
POST_THRESHOLD_SORTS BIGINT post_threshold_sorts - Post threshold sorts
PIPED_SORTS_REQUESTED BIGINT piped_sorts_requested - Piped sorts requested
PIPED_SORTS_ACCEPTED BIGINT piped_sorts_accepted - Piped sorts accepted
REM_CONS_IN BIGINT rem_cons_in - Remote connections to database manager
REM_CONS_IN_EXEC BIGINT rem_cons_in_exec - Remote Connections Executing in the Database Manager monitor element
LOCAL_CONS BIGINT local_cons - Local connections
LOCAL_CONS_IN_EXEC BIGINT local_cons_in_exec - Local Connections Executing in the Database Manager monitor element
CON_LOCAL_DBASES BIGINT con_local_dbases - Local databases with current connects
AGENTS_REGISTERED BIGINT agents_registered - Agents registered
AGENTS_WAITING_ON_TOKEN BIGINT agents_waiting_on_token - Agents waiting for a token
DB2_STATUS VARCHAR(12) db2_status - Status of DB2 instance . This interface returns a text identifier based on defines in sqlmon.h, and is one of:
  • ACTIVE
  • QUIESCE_PEND
  • QUIESCED
AGENTS_REGISTERED_TOP BIGINT agents_registered_top - Maximum number of agents registered
AGENTS_WAITING_TOP BIGINT agents_waiting_top - Maximum number of agents waiting
COMM_PRIVATE_MEM BIGINT comm_private_mem - Committed private memory
IDLE_AGENTS BIGINT idle_agents - Number of idle agents
AGENTS_FROM_POOL BIGINT agents_from_pool - Agents assigned from pool

AGENTS_CREATED_
   EMPTY_POOL

BIGINT agents_created_empty_pool - Agents created due to empty agent pool
COORD_AGENTS_TOP BIGINT coord_agents_top - Maximum number of coordinating agents
MAX_AGENT_OVERFLOWS BIGINT max_agent_overflows - Maximum agent overflows
AGENTS_STOLEN BIGINT agents_stolen - Stolen agents
GW_TOTAL_CONS BIGINT gw_total_cons - Total number of attempted connections for DB2 Connect™
GW_CUR_CONS BIGINT gw_cur_cons - Current number of connections for DB2 Connect
GW_CONS_WAIT_HOST BIGINT gw_cons_wait_host - Number of connections waiting for the host to reply
GW_CONS_WAIT_CLIENT BIGINT gw_cons_wait_client - Number of connections waiting for the client to send request

POST_THRESHOLD_
   HASH_JOINS

BIGINT post_threshold_hash_joins - Hash join threshold
NUM_GW_CONN_SWITCHES BIGINT num_gw_conn_switches - Connection switches
DB2START_TIME TIMESTAMP db2start_time - Start database manager timestamp
LAST_RESET TIMESTAMP last_reset - Last reset timestamp

NUM_NODES_IN_
   DB2_INSTANCE

INTEGER num_nodes_in_db2_instance - Number of nodes in database partition
PRODUCT_NAME VARCHAR(32) product_name - Product name
SERVICE_LEVEL VARCHAR(18) service_level - Service level
SORT_HEAP_TOP BIGINT sort_heap_top - Sort private heap high water mark
DBPARTITIONNUM SMALLINT The database partition from which the data was retrieved for this row.