How can I check the data volume of all tables in DB2?
In DB2, you can use the following SQL query to retrieve the data volume of all tables:
SELECT TABNAME, CARDFROM SYSCAT.TABLES
WHERE TABSCHEMA = 'SCHEMA_NAME' -- 替换为模式名称
AND TYPE = 'T' -- 'T'表示表,'V'表示视图
ORDER BY CARD DESC;
In the above query, replace `SCHEMA_NAME` with the name of the schema (or database) you want to query. It will return the names of all tables and their corresponding data amounts in the specified schema. `CARD` indicates the number of rows in the table. Note: You need to have sufficient permissions to execute the above query.