The SNAPCONTAINER administrative view and the SNAP_GET_CONTAINER_V91 table function return table space snapshot information from the tablespace_container logical data group.
This administrative view allows you to retrieve tablespace_container logical data group snapshot information for the currently connected database.
Used with the SNAPTBSP, SNAPTBSP_PART, SNAPTBSP_QUIESCER and SNAPTBSP_RANGE administrative views, the SNAPCONTAINER administrative view returns data 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 SNAPSHOT_TIMESTAMP, SUBSTR(TBSP_NAME, 1, 15) AS TBSP_NAME,
TBSP_ID, SUBSTR(CONTAINER_NAME, 1, 20) AS CONTAINER_NAME,
CONTAINER_ID, CONTAINER_TYPE, ACCESSIBLE, DBPARTITIONNUM
FROM SYSIBMADM.SNAPCONTAINER ORDER BY DBPARTITIONNUM
SNAPSHOT_TIMESTAMP TBSP_NAME TBSP_ID ...
-------------------------- --------------- -------...- ...
2006-01-08-16.49.24.639945 SYSCATSPACE 0 ...
2006-01-08-16.49.24.639945 TEMPSPACE1 1 ...
2006-01-08-16.49.24.639945 USERSPACE1 2 ...
2006-01-08-16.49.24.639945 SYSTOOLSPACE 3 ...
2006-01-08-16.49.24.640747 TEMPSPACE1 1 ...
2006-01-08-16.49.24.640747 USERSPACE1 2 ...
2006-01-08-16.49.24.639981 TEMPSPACE1 1 ...
2006-01-08-16.49.24.639981 USERSPACE1 2 ...
...
8 record(s) selected.
... CONTAINER_NAME CONTAINER_ID CONTAINER_TYPE ...
... -------------------- ------------...- ---------------- ...
... /home/swalkty/swalkt 0 FILE_EXTENT_TAG ...
... /home/swalkty/swalkt 0 PATH ...
... /home/swalkty/swalkt 0 FILE_EXTENT_TAG ...
... /home/swalkty/swalkt 0 FILE_EXTENT_TAG ...
... /home/swalkty/swalkt 0 PATH ...
... /home/swalkty/swalkt 0 FILE_EXTENT_TAG ...
... /home/swalkty/swalkt 0 PATH ...
... /home/swalkty/swalkt 0 FILE_EXTENT_TAG ...
... ACCESSIBLE DBPARTITIONNUM
... ---------- --------------
... 1 0
... 1 0
... 1 0
... 1 0
... 1 1
... 1 1
... 1 2
... 1 2
The SNAP_GET_CONTAINER_V91 table function returns the same information as the SNAPCONTAINER 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 with the SNAP_GET_TBSP_V91, SNAP_GET_TBSP_PART_V91, SNAP_GET_TBSP_QUIESCER and SNAP_GET_TBSP_RANGE table functions, the SNAP_GET_CONTAINER_V91 table function returns data 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_CONTAINER_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_CONTAINER_V91 table function takes a snapshot for the currently connected database and database partition number.
SELECT SNAPSHOT_TIMESTAMP, TBSP_NAME, TBSP_ID, CONTAINER_NAME,
CONTAINER_ID, CONTAINER_TYPE, ACCESSIBLE
FROM TABLE(SNAP_GET_CONTAINER_V91('',-1)) AS T
SNAPSHOT_TIMESTAMP TBSP_NAME TBSP_ID ...
-------------------------- -------------------- ------- ...
2005-04-25-14.42.10.899253 SYSCATSPACE 0 ...
2005-04-25-14.42.10.899253 TEMPSPACE1 1 ...
2005-04-25-14.42.10.899253 USERSPACE1 2 ...
2005-04-25-14.42.10.899253 SYSTOOLSPACE 3 ...
2005-04-25-14.42.10.899253 MYTEMP 4 ...
2005-04-25-14.42.10.899253 WHATSNEWTEMPSPACE 5 ...
... CONTAINER_NAME CONTAINER_ID ...
... ---------------------------------------- ------------ ...
... D:\DB2\NODE0000\SQL00002\SQLT0000.0 0 ...
... D:\DB2\NODE0000\SQL00002\SQLT0001.0 0 ...
... D:\DB2\NODE0000\SQL00002\SQLT0002.0 0 ...
... D:\DB2\NODE0000\SQL00002\SYSTOOLSPACE 0 ...
... D:\DB2\NODE0000\SQL003 0 ...
... d:\DGTTsWhatsNewContainer 0 ...
... CONTAINER_TYPE ACCESSIBLE
... -------------- ----------
... CONT_PATH 1
... CONT_PATH 1
... CONT_PATH 1
... CONT_PATH 1
... CONT_PATH 1
... CONT_PATH 1
Column name | Data type | Description or corresponding monitor element |
---|---|---|
SNAPSHOT_TIMESTAMP | TIMESTAMP | snapshot_timestamp - Snapshot timestamp monitor element |
TBSP_NAME | VARCHAR(128) | tablespace_name - Table space name |
TBSP_ID | BIGINT | tablespace_id - Table space identification |
CONTAINER_NAME | VARCHAR(256) | container_name - Container name |
CONTAINER_ID | BIGINT | container_id - Container identification |
CONTAINER_TYPE | VARCHAR(16) | container_type - Container type . This
is a text identifier based on the defines in sqlutil.h and is one of:
|
TOTAL_PAGES | BIGINT | container_total_pages - Total pages in container |
USABLE_PAGES | BIGINT | container_usable_pages - Usable pages in container |
ACCESSIBLE | SMALLINT | container_accessible - Accessibility of container |
STRIPE_SET | BIGINT | container_stripe_set - Stripe set |
DBPARTITIONNUM | SMALLINT | The database partition from which the data was retrieved for this row. |
FS_ID | VARCHAR(22) | fs_id - Unique file system identification number |
FS_TOTAL_SIZE | BIGINT | fs_total_size - Total size of a file system |
FS_USED_SIZE | BIGINT | fs_used_size - Amount of space used on a file system |