Tenant system variables in OceanBase Database fall into two categories: global variables and session variables. You can configure these variables to tailor OceanBase Database behavior to meet your business requirements.
- Global variable: Modifications at the global level are shared by all users in the same tenant. Changes to global variables persist after the session ends. In addition, changes to global variables do not take effect for the current session; you must establish a new session for the changes to take effect.
- Session variable: Modifications at the session level. After a client connects to the database, the database automatically copies global variables to create session variables. Changes to session variables apply only to the current session.
Comparison between system variables and system parameters
| Comparison item | System parameter | System variable |
|---|---|---|
| Scope of effect | Cluster, zone, server, or tenant. | Global or session level within a tenant. |
| Activation method |
|
|
| Modification method |
|
Only supports modification through SQL statements. Examples:
|
| Query method | Can be queried through the SHOW PARAMETERS statement, for example: SHOW PARAMETERS LIKE 'schema_history_expire_time';. |
Can be queried through the SHOW [GLOBAL] VARIABLES statement. Examples:
|
| Persistence | Persisted into internal tables and configuration files; can be found 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. |
| Lifecycle | Long-lasting, from process startup to exit. | Short-lived, effective only after successful creation of the tenant's schema. |