The GET_DBSIZE_INFO procedure calculates the database size and maximum capacity.
>>-GET_DBSIZE_INFO--(--snapshot-timestamp--,--dbsize--,---------> >--dbcapacity--,--refresh-window--)----------------------------><
The schema is SYSPROC.
In a non-restrictive database, EXECUTE privilege is granted to PUBLIC when the procedure is automatically created.
CALL GET_DBSIZE_INFO(?, ?, ?, -1)
The procedure returns: Value of output parameters
--------------------------
Parameter Name : SNAPSHOTTIMESTAMP
Parameter Value : 2004-02-29-18.31.55.178000
Parameter Name : DATABASESIZE
Parameter Value : 22302720
Parameter Name : DATABASECAPACITY
Parameter Value : 4684793856
Return Status = 0
CALL GET_DBSIZE_INFO(?, ?, ?, 0)
The procedure returns: Value of output parameters
--------------------------
Parameter Name : SNAPSHOTTIMESTAMP
Parameter Value : 2004-02-29-18.33.34.561000
Parameter Name : DATABASESIZE
Parameter Value : 22302720
Parameter Name : DATABASECAPACITY
Parameter Value : 4684859392
Return Status = 0
CALL GET_DBSIZE_INFO(?, ?, ?, 1440)
The procedure returns: Value of output parameters
--------------------------
Parameter Name : SNAPSHOTTIMESTAMP
Parameter Value : 2004-02-29-18.33.34.561000
Parameter Name : DATABASESIZE
Parameter Value : 22302720
Parameter Name : DATABASECAPACITY
Parameter Value : 4684859392
Return Status = 0
The calculated values are returned as procedure output parameters and are cached in the SYSTOOLS.STMG_DBSIZE_INFO table. The procedure caches these values because the calculations are costly. The SYSTOOLS.STMG_DBSIZE_INFO table is created automatically the first time the procedure executes. If there are values cached in the SYSTOOLS.STMG_DBSIZE_INFO table and they are current enough, as determined by the snapshot-timestamp and refresh-window values, these cached values are returned. If the cached values are not current enough, new cached values are calculated, inserted into the SYSTOOLS.STMG_DBSIZE_INFO table and returned, and the snapshot-timestamp value is updated.
To ensure that the data is returned by all partitions for a global table space snapshot, the database must be activated.
The SYSTOOLSPACE is used for the routine's operation tables to store metadata; that is, data used to describe database objects and their operation.