Purpose
The oceanbase.CDB_OB_SYS_VARIABLES view provides the system variable information about all tenants in the sys tenant.
Note
This view is introduced since OceanBase Database V4.0.0.
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. |
| ISDEFAULT | varchar(3) | NO | Whether it is a default value. |
Example
obclient > select * from oceanbase.CDB_OB_SYS_VARIABLES limit 2;
The result is as follows:
+----------------------------+----------------------------+-----------+-------------------------+-------+-----------+-----------+------------------+-------------------------------------------------------------------------------------------------------------+---------------+-----------+
| CREATE_TIME | MODIFY_TIME | TENANT_ID | NAME | VALUE | MIN_VALUE | MAX_VALUE | SCOPE | INFO | DEFAULT_VALUE | ISDEFAULT |
+----------------------------+----------------------------+-----------+-------------------------+-------+-----------+-----------+------------------+-------------------------------------------------------------------------------------------------------------+---------------+-----------+
| 2023-12-13 13:52:25.771343 | 2023-12-13 13:52:25.771343 | 1 | autocommit | 1 | | | GLOBAL | SESSION | | 1 | YES |
| 2023-12-13 13:52:25.771343 | 2023-12-13 13:52:25.771343 | 1 | automatic_sp_privileges | 1 | | | GLOBAL_ONLY | the server automatically grants the EXECUTE and ALTER ROUTINE privileges to the creator of a stored routine | 1 | YES |
+----------------------------+----------------------------+-----------+-------------------------+-------+-----------+-----------+------------------+-------------------------------------------------------------------------------------------------------------+---------------+-----------+
2 rows in set (0.009 sec)