Note
This view was introduced in version V4.3.4.
Purpose
In Shared-Storage (SS) mode, the
CDB_OB_SPACE_USAGEview records the sizes of spaces occupied by different types of data in different endpoints and paths for each tenant.In Shared-Nothing (SN) mode, the
CDB_OB_SPACE_USAGEview records the details of the storage space occupied by each tenant on 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 endpoint of shared storage. This field is applicable only in Shared-Storage mode. In Shared-Nothing mode, the value of this field is NULL, indicating that it is undefined. |
| PATH | varchar(1024) | NO | The path of shared storage. This field is applicable only in Shared-Storage mode. In Shared-Nothing mode, 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 usage required_size of data, in bytes. |
Sample query
In Shared-Nothing mode, the sys tenant can view detailed information about the total 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