How can I check the usage rate of db2 tablespaces?

To view the usage rate of a DB2 table space, you can use the following command:

  1. Log in to the DB2 database using the db2 command line tool.
  2. Run the following command to check the usage rate of the tablespace:
db2 "SELECT substr(tbsp_name,1,30) AS tbsp_name, (100 - ((T.PAGESIZE - D.TBSP_FREE_PAGES)*100)/T.PAGESIZE) AS PCT_USED FROM syscat.tablespaces AS T, sysibmadm.admintabinfo AS D WHERE T.tbsp_name = D.TBSP_NAME"

This command will return the name and usage rate (in percentage) of each tablespace.

Note: Before running the above command, please make sure to replace the database name. If the database name is not set, the default database should be used.

bannerAds