Size of db2 database

db2udb-db2

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.

Thanks đŸ™‚

Best Answer

There is a TechNote on IBM's support site:

How to calculate the size of a DB2 database

If you want to calculate the size and maximum capacity of your database, you can use the procedure GET_DBSIZE_INFO. This procedure first appeared in DB2 Universal Databaseâ„¢ (DB2 UDB) Version 8.2.

To execute this procedure you should follow these three steps:

  1. Connect to the database for which you want to know the size and maximum capacity.
  2. Execute the procedure GET_DBSIZE_INFO.
  3. Close the connection.

Here is the syntax of the procedure:

 db2 call GET_DBSIZE_INFO (?,?,?,refresh-window)

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.