This topic introduces tenant system variables in OceanBase Database.
System variable categories
In OceanBase Database, a tenant's system variables fall into two categories: global variables and session variables. These variables allow you to tailor OceanBase's behavior to meet specific service requirements.
- A global variable enables modifications on a per tenant basis. Users within the same tenant share these global variable settings. Modifications made to global variables persist beyond the current session. Notably, changes to global variables do not immediately impact the ongoing session; they take effect only upon establishing a new session.
- A session variable enables modifications at the session level. When a client connects to the database, global variable settings are automatically copied to create session-level variables. Changes made to session-level variables are confined to the current session and do not extend beyond it.
Comparison between system parameters and system variables
The following table compares system parameters and system variables.
| Item | System parameter | System variable |
|---|---|---|
| Scope of effect | Divided into cluster, zone, server, or tenant level. | Divided into global or session level within a tenant. |
| Activation method |
|
|
| Modification method |
|
Only supports modification through SQL statements, for example:
|
| 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, for example:
|
| 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. |