Note
This view is available starting with V4.3.4.
Purpose
The CDB_OB_SERVER_SPACE_USAGE view is used to monitor the detailed storage space usage of each tenant on each node.
Columns
| Column | Type | Nullable | Description |
|---|---|---|---|
| TENANT_ID | varchar(128) | NO | The tenant ID. |
| TENANT_NAME | varchar(128) | NO | The tenant name. |
| SERVER_IP | varchar(46) | NO | The IP address of the node containing the tenant Uint. |
| SERVER_PORT | bigint(20) | NO | The port of the node containing the tenant Uint. |
| SPACE_TYPE | varchar(9) | NO | The type. The value can be:
Note
|
| DATA_BYTES | decimal(42,0) | NO | The size of the data content, in bytes. |
| USAGE_BYTES | decimal(42,0) | NO | The size of the disk space actually occupied, in bytes. |
Sample query
In SN mode, query the detailed storage space usage of each node from the sys tenant.
obclient [oceanbase]> SELECT * FROM oceanbase.CDB_OB_SERVER_SPACE_USAGE LIMIT 10;
The query result is as follows:
+-----------+-------------+----------------+-------------+------------+------------+-------------+
| TENANT_ID | TENANT_NAME | SERVER_IP | SERVER_PORT | SPACE_TYPE | DATA_BYTES | USAGE_BYTES |
+-----------+-------------+----------------+-------------+------------+------------+-------------+
| 1 | sys | xx.xx.xx.xx | 2882 | clog Data | 7668902375 | 7668902375 |
| 1 | sys | xx.xx.xx.xx | 2882 | Index Data | 2793 | 24576 |
| 1 | sys | xx.xx.xx.xx | 2882 | Meta Data | 17092608 | 17092608 |
| 1 | sys | xx.xx.xx.xx | 2882 | slog Data | 11952128 | 11952128 |
| 1 | sys | xx.xx.xx.xx | 2882 | Table Data | 4168 | 32768 |
| 1 | sys | xx.xx.xx.xx | 2882 | Tmp Data | 0 | 0 |
| 1002 | mysql001 | xx.xx.xx.xx | 2882 | clog Data | 5898749661 | 5898749661 |
| 1002 | mysql001 | xx.xx.xx.xx | 2882 | Meta Data | 28184576 | 28184576 |
| 1002 | mysql001 | xx.xx.xx.xx | 2882 | slog Data | 26112000 | 26112000 |
| 1002 | mysql001 | xx.xx.xx.xx | 2882 | Table Data | 25268 | 6438912 |
+-----------+-------------+----------------+-------------+------------+------------+-------------+
10 rows in set
References
- Query the sizes of all user tables (in Leader replica mode in a multi-replica environment) under all tenants: oceanbase.CDB_OB_TABLE_SPACE_USAGE
- In SN mode, query the detailed storage space usage of each tenant across all nodes: oceanbase.CDB_OB_SPACE_USAGE
