Tenant system variables in OceanBase Database are divided into global variables and session variables. By setting system variables, you can configure the behavior of OceanBase Database to meet business requirements.
- Global variables: Modifications at the global level apply to all users within the same tenant. Global variable changes do not invalidate upon session exit. However, changes to global variables do not take effect for currently open sessions; you must establish a new session for the changes to apply.
- 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 only affect 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 is divided into global and session levels for tenants. |
| Effective Date |
|
|
| Modification method |
|
It can only be modified by using SQL statements. Example:
|
| Query method | You can useSHOW PARAMETERSStatement query. Example:SHOW PARAMETERS LIKE 'schema_history_expire_time'; |
You can useSHOW [GLOBAL] VARIABLESStatement query. Example:
|
| 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 variables at the global level are persisted; variables at the session level are not. |
| Lifecycle | Long, from process startup to exit. | It takes effect only after the tenant's schema is successfully created. |
