How can I get the size of my UDB DB2 version 9.1 database? I tried firing getdbconfig from the command prompt. It gives all the configuration but not the size.
There is a TechNote on IBM's support site:
To execute this procedure you should follow these three steps:
Here is the syntax of the procedure:
The first three parameters are output parameters, and the refresh-window is an input parameter of type INTEGER that specifies the number of minutes until the cached values for database size and capacity are to be refreshed.
Refer to this documentation link for examples of the output from this procedure in DB2 UDB Version 9.1.
There's a script here which has been tested in 9.1 and, according to the author:
The GET_DBSIZE_INFO procedure calculates the database size and maximum capacity. 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.
The below returns the database size and capacity using a refresh window of 0 minutes. The database size and capacity will be recalculated immediately.
You may query the systools.stmg_dbsize_info directly to get the results as well.