DB2 Version 9.7 for Linux, UNIX, and Windows

SNAPDBM_MEMORY_POOL administrative view and SNAP_GET_DBM_MEMORY_POOL table function - Retrieve database manager level memory usage information

The SNAPDBM_MEMORY_POOL administrative view and the SNAP_GET_DBM_MEMORY_POOL table function return information about memory usage at the database manager.

Note: Starting in Version 9.7 Fix Pack 5, the SNAPDBM_MEMORY_POOL administrative view and SNAP_GET_DBM_MEMORY_POOL table function have been deprecated and replaced by the MON_GET_MEMORY_POOL table function - get memory pool information and MON_GET_MEMORY_SET table function - get memory set information.

SNAPDBM_MEMORY_POOL administrative view

Used with the SNAPDBM, SNAPFCM, SNAPFCM_PART and SNAPSWITCHES administrative views, the SNAPDBM_MEMORY_POOL administrative view provides the data equivalent to the GET SNAPSHOT FOR DBM command.

The schema is SYSIBMADM.

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

Authorization

One of the following authorizations is required:
  • SELECT privilege on the SNAPDBM_MEMORY_POOL administrative view
  • CONTROL privilege on the SNAPDBM_MEMORY_POOL administrative view
  • DATAACCESS authority
In addition, one of the following privileges or authorities is also required:
  • EXECUTE privilege on the SNAP_GET_DBM_MEMORY_POOL table function
  • DATAACCESS authority
In addition, to access snapshot monitor data, one of the following authorities is also required:
  • SYSMON
  • SYSCTRL
  • SYSMAINT
  • SYSADM

Example

Retrieve a list of the memory pools and their current size for the database manager of the connected database.
SELECT POOL_ID, POOL_CUR_SIZE FROM SNAPDBM_MEMORY_POOL
The following example is a sample output from this query.
POOL_ID        POOL_CUR_SIZE 
-------------- --------------------
MONITOR                      65536
OTHER                     29622272
FCMBP                     57606144
...

SNAP_GET_DBM_MEMORY_POOL table function

The SNAP_GET_DBM_MEMORY_POOL table function returns the same information as the SNAPDBM_MEMORY_POOL administrative view, but allows you to retrieve the information for a specific database partition, aggregate of all database partitions or all database partitions.

Used with the SNAP_GET_DBM_V95, SNAP_GET_FCM, SNAP_GET_FCM_PART and SNAP_GET_SWITCHES table functions, the SNAP_GET_DBM_MEMORY_POOL 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_MEMORY_POOL--(--+----------------+--)----------><
                                '-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_MEMORY_POOL table function takes a snapshot for the currently connected database and database partition number.

Authorization

One of the following authorizations is required:
  • EXECUTE privilege on the SNAP_GET_DBM_MEMORY_POOL table function
  • DATAACCESS authority
In addition, to access snapshot monitor data, one of the following authorities is also required:
  • SYSMON
  • SYSCTRL
  • SYSMAINT
  • SYSADM

Example

Retrieve a list of the memory pools and their current size for all database partitions of the database manager of the connected database.
SELECT POOL_ID, POOL_CUR_SIZE, DBPARTITIONNUM 
   FROM TABLE(SYSPROC.SNAP_GET_DBM_MEMORY_POOL()) 
   AS T ORDER BY DBPARTITIONNUM
The following example is a sample output from this query.
POOL_ID        POOL_CUR_SIZE        DBPARTITIONNUM
-------------- -------------------- --------------
MONITOR                       65536              0
OTHER                      29622272              0
FCMBP                      57606144              0
MONITOR                       65536              1
OTHER                      29425664              1
FCMBP                      57606144              1
MONITOR                       65536              2
OTHER                      29425664              2
FCMBP                      57606144              2

Information returned

Table 1. Information returned by the SNAPDBM_MEMORY_POOL administrative view and the SNAP_GET_DBM_MEMORY_POOL table function
Column name Data type Description or corresponding monitor element
SNAPSHOT_TIMESTAMP TIMESTAMP snapshot_timestamp - Snapshot timestamp monitor element
POOL_ID VARCHAR(14) pool_id - Memory pool identifier . This interface returns a text identifier based on defines in sqlmon.h, and is one of:
  • APP_GROUP
  • APPL_CONTROL
  • APPLICATION
  • BP
  • CAT_CACHE
  • DATABASE
  • DFM
  • FCMBP
  • IMPORT_POOL
  • LOCK_MGR
  • MONITOR
  • OTHER
  • PACKAGE_CACHE
  • QUERY
  • SHARED_SORT
  • SORT
  • STATEMENT
  • STATISTICS
  • UTILITY
POOL_CUR_SIZE BIGINT pool_cur_size - Current size of memory pool
POOL_WATERMARK BIGINT pool_watermark - Memory pool watermark
POOL_CONFIG_SIZE BIGINT pool_config_size - Configured size of memory pool
DBPARTITIONNUM SMALLINT The database partition from which the data was retrieved for this row.