Note
This view was introduced in OceanBase Database V4.3.4.
Purpose
The CDB_OB_SERVER_SPACE_USAGE view is used to monitor the details of storage space usage by tenants on each node.
Columns
| Column | Type | Nullable? | Description |
|---|---|---|---|
| TENANT_ID | varchar(128) | NO | Tenant ID |
| TENANT_NAME | varchar(128) | NO | Tenant name |
| SERVER_IP | varchar(46) | NO | IP address of the node that contains the tenant unit |
| SERVER_PORT | bigint(20) | NO | PORT of the node that contains the tenant unit |
| SPACE_TYPE | varchar(9) | NO | The types are as follows:
Note
|
| DATA_BYTES | decimal(42,0) | NO | Size of data content, in bytes |
| USAGE_BYTES | decimal(42,0) | NO | Actual size of disk space occupied, in bytes |
Sample query
The following example queries the details of storage space usage by tenants on each node in standalone (SN) mode.
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