The SNAPTBSP administrative view and the SNAP_GET_TBSP_V91 table function return snapshot information from the table space logical data group.
This administrative view allows you to retrieve table space logical data group snapshot information for the currently connected database.
Used in conjunction with the SNAPTBSP_PART, SNAPTBSP_QUIESCER, SNAPTBSP_RANGE, SNAPCONTAINER administrative views, the SNAPTBSP administrative view returns information equivalent to the GET SNAPSHOT FOR TABLESPACES ON database-alias CLP command.
The schema is SYSIBMADM.
Refer to Table 1 for a complete list of information that can be returned.
SELECT SUBSTR(TBSP_NAME,1,30) AS TBSP_NAME, TBSP_ID, TBSP_TYPE,
TBSP_CONTENT_TYPE FROM SYSIBMADM.SNAPTBSP WHERE DBPARTITIONNUM = 1
TBSP_NAME TBSP_ID TBSP_TYPE TBSP_CONTENT_TYPE
---------- -------...- ---------- -----------------
TEMPSPACE1 1 SMS SYSTEMP
USERSPACE1 2 DMS LONG
2 record(s) selected.
The SNAP_GET_TBSP_V91 table function returns the same information as the SNAPTBSP administrative view, but allows you to retrieve the information for a specific database on a specific database partition, aggregate of all database partitions or all database partitions.
Used in conjunction with the SNAP_GET_TBSP_PART_V91, SNAP_GET_TBSP_QUIESCER, SNAP_GET_TBSP_RANGE, SNAP_GET_CONTAINER_V91 table functions, the SNAP_GET_TBSP_V91 table function returns information equivalent to the GET SNAPSHOT FOR TABLESPACES ON database-alias CLP command.
Refer to Table 1 for a complete list of information that can be returned.
>>-SNAP_GET_TBSP_V91--(--dbname--+------------------+--)------->< '-, dbpartitionnum-'
The schema is SYSPROC.
If both dbname and dbpartitionnum 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_TBSP_V91 table function takes a snapshot for the currently connected database and database partition number.
SELECT SUBSTR(TBSP_NAME,1,10) AS TBSP_NAME, TBSP_ID, TBSP_TYPE,
TBSP_CONTENT_TYPE, DBPARTITIONNUM FROM TABLE(SNAP_GET_TBSP_V91('')) AS T
TBSP_NAME TBSP_ID TBSP_TYPE TBSP_CONTENT_TYPE DBPARTITIONNUM
---------- -------...- ---------- ----------------- --------------
TEMPSPACE1 1 SMS SYSTEMP 1
USERSPACE1 2 DMS LONG 1
SYSCATSPAC 0 DMS ANY 0
TEMPSPACE1 1 SMS SYSTEMP 0
USERSPACE1 2 DMS LONG 0
SYSTOOLSPA 3 DMS LONG 0
TEMPSPACE1 1 SMS SYSTEMP 2
USERSPACE1 2 DMS LONG 2
8 record(s) selected.