How to view the size of data in a table in DB2?

You can use the following command to view the data size of a DB2 table:

  1. Connect to the target database using the command “db2 connect to “.
  2. Use the command SELECT TABNAME, SUM(CARD) as Total_Rows, SUM(DATA_OBJECT_P_SIZE) as Total_Size FROM SYSCAT.TABLES WHERE TABSCHEMA = ‘‘ GROUP BY TABNAME to obtain the data size of each table in a specified schema (in bytes).

Please make sure to replace with the name of the target database and with the name of the target schema.

bannerAds