Tenant system variables in OceanBase AI Database are divided into global variables and session variables. By setting system variables, you can configure the behavior of OceanBase AI Database to meet business requirements.
- Global variables: Modifications at the global level apply to all users in the same tenant. Global variable changes do not become invalid when a session exits. However, changes to global variables do not take effect for currently open sessions. You must establish a new session for the changes to take effect.
- Session variables: Modifications at the session level apply only to the current session. When a client connects to the database, the database automatically generates session variables based on global variables. Changes to session variables take effect only for the current session.
Comparison between system variables and system parameters:
Comparison item |
System parameters |
System variables |
|---|---|---|
| Effective scope | It is divided into clusters, zones, servers, and tenants. | It can be set to the global or session level for a tenant. |
| Effective mode |
|
|
| Modification method |
|
It can be modified only by using SQL statements. Example:SET ob_query_timeout = 20000000;SET GLOBAL ob_query_timeout = 20000000; |
| Query method | You can use the SHOW PARAMETERS statement to query parameters. Example: SHOW PARAMETERS LIKE 'schema_history_expire_time'; |
You can use the SHOW [GLOBAL] VARIABLES statement to query variables. Example:SHOW VARIABLES LIKE 'ob_query_timeout';SHOW GLOBAL VARIABLES LIKE 'ob_query_timeout'; |
| Persistence | The configuration is persisted to internal tables and the configuration file. 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 global-level variables are persisted. Session-level variables are not persisted. |
| Lifecycle | Long, from process startup to exit. | Short. It takes effect only after the tenant's schema is created successfully. |