Note
This view is available starting with V4.3.4.
Purpose
The CDB_OB_SPACE_USAGE view records the detailed storage space occupied by each tenant across all nodes.
Columns
Column |
Type |
Nullable |
Description |
|---|---|---|---|
| TENANT_ID | varchar(128) | NO | The tenant ID. |
| TENANT_NAME | varchar(128) | NO | The tenant name. |
| ENDPOINT | varchar(1024) | NO | The value of this field is NULL, indicating that it is undefined. |
| PATH | varchar(1024) | NO | The value of this field is NULL, indicating that it is undefined. |
| SPACE_TYPE | varchar(11) | NO |
|
| USAGE_BYTES | decimal(42,0) | NO | The actual disk space occupied by the data, measured in bytes. |
Sample query
Query the CDB_OB_SPACE_USAGE view to view the detailed disk space occupied by each tenant across all nodes.
obclient [oceanbase]> SELECT * FROM oceanbase.CDB_OB_SPACE_USAGE LIMIT 10;
The query result is as follows:
+-----------+-------------+----------+------+-------------+-------------+
| TENANT_ID | TENANT_NAME | ENDPOINT | PATH | SPACE_TYPE | USAGE_BYTES |
+-----------+-------------+----------+------+-------------+-------------+
| 1 | sys | NULL | NULL | clog Data | 7680321279 |
| 1 | sys | NULL | NULL | Shared Data | 0 |
| 1 | sys | NULL | NULL | Local Data | 122265600 |
| 1002 | mysql001 | NULL | NULL | clog Data | 5925397177 |
| 1002 | mysql001 | NULL | NULL | Shared Data | 0 |
| 1002 | mysql001 | NULL | NULL | Local Data | 106221568 |
| 1004 | oracle001 | NULL | NULL | clog Data | 5970846734 |
| 1004 | oracle001 | NULL | NULL | Local Data | 90218496 |
| 1004 | oracle001 | NULL | NULL | Shared Data | 0 |
+-----------+-------------+----------+------+-------------+-------------+
9 rows in set
References
- View the sizes of all user tables (based on the Leader replica in a multi-replica environment) under all tenants: oceanbase.CDB_OB_TABLE_SPACE_USAGE
- View the detailed storage space usage of each tenant on each node: oceanbase.CDB_OB_SERVER_SPACE_USAGE
