db2 "call get_dbsize_info(?,?,?,0)"
GET_DBSIZE_INFO is a stored procedure which calculates the size of the database (used space) and its maximum capacity (allocated space).
The DBSIZE is calculated as:
dbsize = SUM (Used pages in a tablespace X Page Size) for each tablespace and is returned in bytes
The DBCAPACITY is calculated as:
dbcapacity = SUM (DMS usable pages X Page Size) + SUM (SMS container size + file system free size per container) + Transaction LOG Size
These computed values are cached in the table SYSTOOLS.STMG_DBSIZE_INFO. The procedure can be invoked such that it will try to fetch the cached values(based on the refresh-window parameter) from this table instead of re-computing them.
for example:
To get the cached value not older than the system default of 30 minutes give the following command:
db2 "call get_dbsize_info(?,?,?,-1)"
If the value cached in the table SYSTOOLS.STMG_DBSIZE_INFO is older than 30 mins, db2 will compute the new values and populate them into the table, else it will display the old values.
To get the cached value not older than 12 hours (720 minutes) give the following command:
db2 "call get_dbsize_info(?,?,?,720)"
Note: For some reasons there is much variance in the value calculated for DBCAPACITY. In three runs of the procedure within 3 minutes, I got three different values 8368693302784 (7793 GB), 9007135917568 (8388 GB) and 9643684177408 (8981 GB). The value calculated for DBSIZE is consistent though.
| Comments |
|
Powered by !JoomlaComment 3.25





