---
slug: /system-variable-overview
---

# System variables

The system variables of OceanBase Database are divided into global variables and session variables. You can set system variables to meet business requirements.

* Global variables: Global variables are modified at the global level. All users of OceanBase Database share global variables. The modification of global variables does not take effect after the session ends. In addition, the modification of global variables does not take effect on sessions that are already open. You must reestablish a session for the modification to take effect.
* Session variables: Session variables are modified at the session level. When a client connects to OceanBase Database, OceanBase Database automatically generates session variables by copying global variables. The modification of session variables takes effect only on the current session.

The following table describes the differences between system variables and system parameters.

| Item | System parameter | System variable |
|---------|-----------|---------|
| Scope | Instance | Global or session |
| Effective method | <ul><li>Dynamic effective: <code>edit_level</code> is <code>dynamic_effective</code></li><li>Effective after restart: <code>edit_level</code> is <code>static_effective</code></li></ul> | <ul><li>Setting a session-level variable takes effect only on the current session. </li><li>Setting a global-level variable takes effect only after you log in and establish a new session. </li></ul> |
| Modification method | <ul><li>You can modify a system parameter by using an SQL statement. Example: <code>Alter SYSTEM SET schema_history_expire_time='1h';</code></li><li>You can modify a system parameter by using a startup parameter. Example: <code>/usr/bin/observer --base-dir /var/lib/oceanbase-lite --schema_history_expire_time=1h;</code> </li></ul>| You can modify a system variable by using an SQL statement. Example: <code>SET ob_query_timeout = 20000000;</code> or <code>SET GLOBAL ob_query_timeout = 20000000;</code>|
| Query method | You can execute the `SHOW PARAMETERS` statement to query system parameters. Example: `SHOW PARAMETERS LIKE 'schema_history_expire_time';` | You can execute the `SHOW [GLOBAL] VARIABLES` statement to query system variables. Example: `SHOW VARIABLES LIKE 'ob_query_timeout';` or `SHOW GLOBAL VARIABLES LIKE 'ob_query_timeout';`|
| Lifetime | Long: from the time when the process starts to the time when it exits. | Short: takes effect only after a schema is created. |

## References

* [Overview of configuration parameters and system variables](../100.configuration-management-introduction.md)

* [View system variables](200.view-system-variables.md)

* [Modify system variables](300.modify-system-variables.md)