IBM Support

How to calculate the size of a DB2 database

Question & Answer


Question

This technote describes how to use the GET_DBSIZE_INFO procedure to calculate the size and maximum capacity of a database in DB2® for Linux®, UNIX® and Windows®.

Answer

If you want to calculate the size and maximum capacity of your database, you can use the procedureGET_DBSIZE_INFO.

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.

For the second step, you should take into account the syntax of the procedure:
db2 call GET_DBSIZE_INFO (?,?,?,refresh-window)

where the first 3 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.

Furthermore, to valid the above data, you can use db2pd -tablespaces output, by adding up all the Tablespace Statistics: UsedPgs for all the containers

Refer to the documentation links below for examples of the output from this procedure in DB2 UDB .

Related Information

[{"Product":{"code":"SSEPGG","label":"Db2 for Linux, UNIX and Windows"},"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Component":"Routines (SP & UDF) - Internal Routines","Platform":[{"code":"PF002","label":"AIX"},{"code":"PF010","label":"HP-UX"},{"code":"PF015","label":"IRIX"},{"code":"PF016","label":"Linux"},{"code":"PF027","label":"Solaris"},{"code":"PF033","label":"Windows"}],"Version":"9.7;10.1;10.5;11.1","Edition":"","Line of Business":{"code":"LOB10","label":"Data and AI"}}]

Document Information

Modified date:
16 June 2018

UID

swg21231144