The CAPTURE_STORAGEMGMT_INFO procedure attempts to collect the storage-related information for the given root object, as well as the storage objects defined within its scope. All the storage objects are specified in the SYSTOOLS.STMG_OBJECT_TYPE table.
Column name | Data type | Nullable | Description |
---|---|---|---|
OBJ_TYPE | INTEGER | N | Integer value corresponds to a type of storage
object
|
TYPE_NAME | VARCHAR | N | Descriptive name of the storage object type
|
>>-CAPTURE_STORAGEMGMT_INFO--(--in_rootType--,------------------> >--in_rootSchema--,--in_rootName -)----------------------------><
The schema is SYSPROC.
create_storagemgmt_tables(TABLESPACE_NAME) where 'TABLESPACE' is the name of the table space, on which storage management tables would be created.
(In case of a problem with the existing storage management tables, it can be dropped using the following stored procedure and can be re-created using the previously described stored procedure.
drop_storagemgmt_tables(0 or 1) where '0' or '1 'indicates 'stop' or 'proceed' on encountering an error.)
RUNSTATS ON TABLE (TABLESCHEMA.TABLENAME) ON KEY COLUMNS AND INDEXES ALL
Run 'capture_storagemgnt_info()' stored procedure to populate the storage management tables. Sometimes it might be necessary to run the CAPTURE_STORAGEMGMT_INFO procedure twice. The first time you run it, use the CAPTURE_STORAGEMGMT_INFO procedure to populate the storage tables with table space details. For example:
db2 "call capture_storagemgmt_info(0,<SCHEMA_NAME>,<DATABASE_NAME>)"
The second time, use the CAPTURE_STORAGEMGMT_INFO procedure to add details about the storage of the actual object to the storage table. For example, the following example adds details for an object of type index (the in_rootType argument is set to 5):
db2 "call capture_storagemgmt_info(5,<SCHEMA_NAME>,<SCHEMA_NAME.INDEX_NAME>)"
db2 "SELECT * FROM SYSTOOLS.STMG_INDEX"