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:
- Connect to the target database using the command “db2 connect to
“. - 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