How to view the space occupied by a table in DB2?
You can use the following command to view the space used by DB2 tables:
- First, log in to the DB2 database management system.
- Use the following command to switch to the database you want to query:
- Establish a connection to the database named database_name.
- The database_name here refers to the name of the database to be queried.
- Use the following command to see the space occupied by the table:
- Retrieve the total size of the table and its indexes in a specified schema and table.
- The schema_name here refers to the name of the schema where the table is located, and table_name is the name of the table to be queried.
- This command utilizes the SYSIBMADM.ADMINTABINFO system view, which contains information about database tables, including space utilization.
- After executing the command, the occupied space of the specified table will be displayed.