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:

  1. First, log in to the DB2 database management system.
  2. Use the following command to switch to the database you want to query:
  3. Establish a connection to the database named database_name.
  4. The database_name here refers to the name of the database to be queried.
  5. Use the following command to see the space occupied by the table:
  6. Retrieve the total size of the table and its indexes in a specified schema and table.
  7. 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.
  8. This command utilizes the SYSIBMADM.ADMINTABINFO system view, which contains information about database tables, including space utilization.
  9. After executing the command, the occupied space of the specified table will be displayed.
bannerAds