Note
This view was introduced in OceanBase Database V4.0.0.
Purpose
The oceanbase.CDB_OB_SYS_VARIABLES view displays the information about the system variables of all tenants.
Columns
| Column | Type | Nullable? | Description |
|---|---|---|---|
| CREATE_TIME | timestamp(6) | NO | The time when the system variable was created. |
| MODIFY_TIME | timestamp(6) | NO | The time when the system variable was modified. |
| TENANT_ID | bigint(20) | NO | The ID of the tenant. |
| NAME | varchar(128) | NO | The name of the system variable. |
| VALUE | varchar(65536) | YES | The value of the system variable. |
| MIN_VALUE | varchar(65536) | NO | The minimum value of the system variable. |
| MAX_VALUE | varchar(65536) | NO | The maximum value of the system variable. |
| SCOPE | varchar(16) | NO | The scope where the variable takes effect. Valid values: GLOBAL_ONLY: The variable takes effect at the tenant level.SESSION_ONLY: The variable takes effect at the session level.GLOBAL \| SESSION: The variable takes effect at the tenant or session level. |
| INFO | varchar(4096) | NO | The description of the variable. |
| DEFAULT_VALUE | varchar(65536) | YES | The default value of the system variable.
Note
|
| ISDEFAULT | varchar(3) | NO | Indicates whether the current value is the default value.
Note
|
Sample query
Query the ob_query_timeout system variable of all tenants from the sys tenant.
obclient [oceanbase]> SELECT * FROM oceanbase.CDB_OB_SYS_VARIABLES WHERE NAME='ob_query_timeout';
The query result is as follows:
+----------------------------+----------------------------+-----------+------------------+----------+-----------+-----------+------------------+----------------------------------+---------------+-----------+
| CREATE_TIME | MODIFY_TIME | TENANT_ID | NAME | VALUE | MIN_VALUE | MAX_VALUE | SCOPE | INFO | DEFAULT_VALUE | ISDEFAULT |
+----------------------------+----------------------------+-----------+------------------+----------+-----------+-----------+------------------+----------------------------------+---------------+-----------+
| 2024-07-23 15:16:40.982646 | 2024-07-23 15:16:40.982646 | 1 | ob_query_timeout | 10000000 | | | GLOBAL | SESSION | Query timeout in microsecond(us) | 10000000 | YES |
| 2024-07-23 15:19:51.404894 | 2024-07-23 15:19:51.404894 | 1001 | ob_query_timeout | 10000000 | | | GLOBAL | SESSION | Query timeout in microsecond(us) | 10000000 | YES |
| 2024-07-23 15:19:59.763474 | 2024-07-23 15:19:59.763474 | 1002 | ob_query_timeout | 10000000 | | | GLOBAL | SESSION | Query timeout in microsecond(us) | 10000000 | YES |
| 2024-07-23 15:20:30.120028 | 2024-07-23 15:20:30.120028 | 1003 | ob_query_timeout | 10000000 | | | GLOBAL | SESSION | Query timeout in microsecond(us) | 10000000 | YES |
| 2024-07-23 15:20:40.848027 | 2024-07-23 15:20:40.848027 | 1004 | ob_query_timeout | 10000000 | | | GLOBAL | SESSION | Query timeout in microsecond(us) | 10000000 | YES |
+----------------------------+----------------------------+-----------+------------------+----------+-----------+-----------+------------------+----------------------------------+---------------+-----------+
5 rows in set