Note
For V4.2.5, this view is available starting from V4.2.5 BP3.
Overview
Displays the size of all user tables in the current tenant (based on the leader replica in a multi-replica environment).
Columns
Field |
Type |
Nullable |
Description |
|---|---|---|---|
| TABLE_ID | bigint(20) | NO | Table ID |
| DATABASE_NAME | varchar(128) | NO | Database Name |
| TABLE_NAME | varchar(256) | NO | Table name |
| OCCUPY_SIZE | decimal(42,0) | NO | Data volume stored on disk after table compression, in bytes |
| REQUIRED_SIZE | decimal(42,0) | NO | The actual disk space occupied by the compressed data on disk, in bytes |
Sample query
You can view the sizes of all user tables in the current tenant.
obclient [test]> SELECT * FROM oceanbase.DBA_OB_TABLE_SPACE_USAGE LIMIT 3;
The query result is as follows:
+----------+---------------+--------------------------------+-------------+---------------+
| TABLE_ID | DATABASE_NAME | TABLE_NAME | OCCUPY_SIZE | REQUIRED_SIZE |
+----------+---------------+--------------------------------+-------------+---------------+
| 500011 | test | wide_table_row_storage2 | 4495925120 | 4613763072 |
| 500012 | test | wide_table_column_storage2 | 3915023145 | 4195397632 |
| 500014 | test | wide_table_row_column_storage2 | 8410964107 | 9805275136 |
+----------+---------------+--------------------------------+-------------+---------------+
3 rows in set
