This topic describes how to modify and query parameters and system variables in OceanBase AI Database, and explains the differences between their usage.
Parameters
Parameters control features such as load balancing, major compaction timing, major compaction mode, resource allocation, and module switches for a cluster.
Parameter types
Parameters in OceanBase AI Database are divided into cluster-level parameters and tenant-level parameters.
Cluster-level parameters: These apply to the entire OceanBase AI Database cluster. They are global in nature and configure basic information, performance parameters, security options, and so on for the entire cluster. These typically include configuration options for data backup and recovery, load balancing, etc. Cluster-level parameters are usually configured during cluster startup and are not easily modified afterward.
Tenant-level parameters: These apply to a single tenant or multiple tenants. They are used to configure and optimize a single tenant or multiple tenants specifically. These typically include configuration options for storage engine parameters, SQL execution strategies, access control, etc. Tenant-level parameters can usually be configured during tenant creation and management and can be modified as needed at any time.
Note
Parameters generally take effect either dynamically or after a restart. Most parameters take effect dynamically, meaning they do not require a restart of the OBServer node to take effect.
Query parameters
To check whether a parameter is cluster-level or tenant-level, use the following method:
obclient> SHOW PARAMETERS LIKE 'max_syslog_file_count';
The return result is as follows:
+-------+----------+----------------+----------+-----------------------+-----------+-------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+----------+---------+---------+-------------------+---------------+-----------+
| zone | svr_type | svr_ip | svr_port | name | data_type | value | info | section | scope | source | edit_level | default_value | isdefault |
+-------+----------+----------------+----------+-----------------------+-----------+-------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+----------+---------+---------+-------------------+---------------+-----------+
| zone1 | observer | 172.xx.xxx.xxx | 2882 | max_syslog_file_count | INT | 0 | specifies the maximum number of the log files that can co-exist before the log file recycling kicks in. Each log file can occupy at most 256MB disk space. When this value is set to 0, no log file will be removed. Range: [0, +∞) in integer | OBSERVER | CLUSTER | DEFAULT | DYNAMIC_EFFECTIVE | 0 | 1 |
+-------+----------+----------------+----------+-----------------------+-----------+-------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+----------+---------+---------+-------------------+---------------+-----------+
1 row in set
In the result, if the value in the scope column is CLUSTER, the parameter is cluster-level; if the value in the scope column is TENANT, the parameter is tenant-level.
System variables
System variables control various behaviors of the database system, such as cache size, concurrent connections, CPU usage, memory usage, and so on. System variables can also be used to configure various features of the database system.
System variable types
System variables in OceanBase AI Database are divided into global variables and session variables.
Global variables: Modifications made to global variables are shared by different users within the same tenant of the database. Changes to global variables do not become invalid when a session exits. Furthermore, changes to global variables do not take effect immediately for currently open sessions; you must establish a new session for the changes to take effect.
Session variables: Modifications made to session variables affect only the current session. After a client connects to the database, the database automatically generates session variables based on global variables. Changes to session variables only take effect for the current session.
Query system variables
To query the value of the current system variable, use the following statement:
obclient [oceanbase]> SHOW VARIABLES LIKE 'ob_query_timeout';
obclient [oceanbase]> SHOW GLOBAL VARIABLES LIKE 'ob_query_timeout';
To query the modification records of global variables and their default values, use the following statement:
obclient [oceanbase]> SELECT * FROM oceanbase.DBA_OB_SYS_VARIABLES WHERE NAME='ob_query_timeout';
Distinguish between parameters and system variables
Comparison Items |
Parameter |
System Variables |
|---|---|---|
| Effective Scope | It is divided into clusters, zones, servers, and tenants. | Divided into global or session levels for tenants. |
| Effective Date |
|
|
| Modification method |
|
It can only be modified using SQL statements. Example:SET ob_query_timeout = 20000000;SET GLOBAL ob_query_timeout = 20000000; |
| Query Method | You can useSHOW PARAMETERSStatement query. Example:SHOW PARAMETERS LIKE 'schema_history_expire_time'; |
You can useSHOW [GLOBAL] VARIABLESStatement query. Example:SHOW VARIABLES LIKE 'ob_query_timeout';SHOW GLOBAL VARIABLES LIKE 'ob_query_timeout'; |
| Persistence | If persisted to internal tables and configuration files, you can query this parameter in the /home/admin/oceanbase/etc/observer.config.bin and /home/admin/oceanbase/etc/observer.config.bin.history files. |
Only variables at the global level are persisted; session-level variables are not persisted. |
| Lifecycle | Long, from process startup to exit. | It takes effect only after the tenant's schema is successfully created. |
References
For more information about parameters, see Parameter overview.
For more information about how to view and set parameters, see the Set parameters topic.
For more information about system variables, see Overview of system variables.
For more information about how to view and set system variables, see the Set variables topic.