OceanBase logo

OceanBase

A unified distributed database ready for your transactional, analytical, and AI workloads.

DEPLOY YOUR WAY

OceanBase Cloud

The best way to deploy and scale OceanBase

OceanBase Enterprise

Run and manage OceanBase on your infra

TRY OPEN SOURCE

OceanBase Community Edition

The free, open-source distributed database

OceanBase seekdb

Open source AI native search database

Customer Stories

Real-world success stories from enterprises across diverse industries.

View All
BY USE CASES

Mission-Critical Transactions

Global & Multicloud Application

Elastic Scaling for Peak Traffic

Real-time Analytics

Active Geo-redundancy

Database Consolidation

Resources

Comprehensive knowledge hub for OceanBase.

Blog

Live Demos

Training & Certification

Documentation

Official technical guides, tutorials, API references, and manuals for all OceanBase products.

View All
PRODUCTS

OceanBase Cloud

OceanBase Database

Tools

Connectors and Middleware

QUICK START

OceanBase Cloud

OceanBase Database

BEST PRACTICES

Practical guides for utilizing OceanBase more effectively and conveniently

Company

Learn more about OceanBase – our company, partnerships, and trust and security initiatives.

About OceanBase

Partner

Trust Center

Contact Us

International - English
中国站 - 简体中文
日本 - 日本語
Sign In
Start on Cloud

A unified distributed database ready for your transactional, analytical, and AI workloads.

DEPLOY YOUR WAY

OceanBase Cloud

The best way to deploy and scale OceanBase

OceanBase Enterprise

Run and manage OceanBase on your infra

TRY OPEN SOURCE

OceanBase Community Edition

The free, open-source distributed database

OceanBase seekdb

Open source AI native search database

Customer Stories

Real-world success stories from enterprises across diverse industries.

View All
BY USE CASES

Mission-Critical Transactions

Global & Multicloud Application

Elastic Scaling for Peak Traffic

Real-time Analytics

Active Geo-redundancy

Database Consolidation

Comprehensive knowledge hub for OceanBase.

Blog

Live Demos

Training & Certification

Documentation

Official technical guides, tutorials, API references, and manuals for all OceanBase products.

View All
PRODUCTS
OceanBase CloudOceanBase Database
ToolsConnectors and Middleware
QUICK START
OceanBase CloudOceanBase Database
BEST PRACTICES

Practical guides for utilizing OceanBase more effectively and conveniently

Learn more about OceanBase – our company, partnerships, and trust and security initiatives.

About OceanBase

Partner

Trust Center

Contact Us

Start on Cloud
编组
All Products
    • Databases
    • iconOceanBase Database
    • iconOceanBase Cloud
    • iconOceanBase Tugraph
    • iconInteractive Tutorials
    • iconOceanBase Best Practices
    • Tools
    • iconOceanBase Cloud Platform
    • iconOceanBase Migration Service
    • iconOceanBase Developer Center
    • iconOceanBase Migration Assessment
    • iconOceanBase Admin Tool
    • iconOceanBase Loader and Dumper
    • iconOceanBase Deployer
    • iconKubernetes operator for OceanBase
    • iconOceanBase Diagnostic Tool
    • iconOceanBase Binlog Service
    • Connectors and Middleware
    • iconOceanBase Database Proxy
    • iconEmbedded SQL in C for OceanBase
    • iconOceanBase Call Interface
    • iconOceanBase Connector/C
    • iconOceanBase Connector/J
    • iconOceanBase Connector/ODBC
    • iconOceanBase Connector/NET
icon

OceanBase Database

SQL - V4.3.3

    Download PDF

    OceanBase logo

    The Unified Distributed Database for the AI Era.

    Follow Us
    Products
    OceanBase CloudOceanBase EnterpriseOceanBase Community EditionOceanBase seekdb
    Resources
    DocsBlogLive DemosTraining & Certification
    Company
    About OceanBaseTrust CenterLegalPartnerContact Us
    Follow Us

    © OceanBase 2026. All rights reserved

    Cloud Service AgreementPrivacy PolicySecurity
    Contact Us
    Document Feedback
    1. Documentation Center
    2. OceanBase Database
    3. SQL
    4. V4.3.3
    iconOceanBase Database
    SQL - V 4.3.3
    SQL
    KV
    • V 4.4.2
    • V 4.3.5
    • V 4.3.3
    • V 4.3.1
    • V 4.3.0
    • V 4.2.5
    • V 4.2.2
    • V 4.2.1
    • V 4.2.0
    • V 4.1.0
    • V 4.0.0
    • V 3.1.4 and earlier

    Overview

    Last Updated:2024-12-02 03:48:29  Updated
    share
    What is on this page
    Parameters
    Categories of parameters
    Query parameters
    System variables
    Categories of system variables
    Query system variables
    Differences between parameters and system variables
    References

    folded

    share

    This topic describes the information about parameters and system variables, such as their modification and query, and the differences in using parameters and system variables in OceanBase Database.

    Parameters

    You can set these parameters to control the load balancing, major compaction time, major compaction mode, resource allocation, and module switches of a cluster.

    Categories of parameters

    OceanBase Database provides cluster-level and tenant-level parameters.

    • Cluster-level parameters specify the basic information and performance and security options of an entire OceanBase cluster. Typical cluster-level parameters are those used for global tasks, such as data backup and restore, and load balancing. Usually, cluster-level parameters are specified during cluster startup and are seldom modified.

    • Tenant-level parameters specify feature options of one or more tenants to optimize specific configurations of the tenants. Typical tenant-level parameters are those used for the storage engine, SQL execution strategies, and access control. Usually, tenant-level parameters are specified when you create and manage a tenant, and can be modified as needed at any time.

    Note

    Most parameters take effect immediately after you set or modify their values, while some parameters take effect after you restart the OBServer node.

    Query parameters

    To query whether a parameter is a cluster-level or tenant-level parameter, use the following statement:

    obclient> SHOW PARAMETERS LIKE 'max_syslog_file_count';
    

    The return result is as follows:

    +-------+----------+----------------+----------+-----------------------+-----------+-------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+----------+---------+---------+-------------------+---------------+-----------+
    | zone  | svr_type | svr_ip         | svr_port | name                  | data_type | value | info                                                                                                                                                                                                                                             | section  | scope   | source  | edit_level        | default_value | isdefault |
    +-------+----------+----------------+----------+-----------------------+-----------+-------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+----------+---------+---------+-------------------+---------------+-----------+
    | zone1 | observer | 172.xx.xxx.xxx |     2882 | max_syslog_file_count | INT       | 0     | specifies the maximum number of the log files that can co-exist before the log file recycling kicks in. Each log file can occupy at most 256MB disk space. When this value is set to 0, no log file will be removed. Range: [0, +∞) in integer   | OBSERVER | CLUSTER | DEFAULT | DYNAMIC_EFFECTIVE | 0             |         1 |
    +-------+----------+----------------+----------+-----------------------+-----------+-------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+----------+---------+---------+-------------------+---------------+-----------+
    1 row in set
    

    If the value in the scope column is CLUSTER, the parameter is a cluster-level parameter. If the value in the scope column is TENANT, the parameter is a tenant-level parameter.

    System variables

    System variables allow you to control behaviors of a database system, such as the cache size, number of concurrent connections, CPU utilization, and memory usage. You can also use system variables to configure various features of the database system.

    Categories of system variables

    The system variables of OceanBase Database can be categorized into global variables and session-level variables.

    • A global variable is used to implement a global modification. Different users of the same database tenant share the settings of global variables. Modification to global variables remains effective after you exit the session. In addition, modification to a global variable does not take effect on the currently open session and takes effect only after a new session is established.

    • A session-level variable is used to implement a session modification. When a client is connected to the database, the database copies global variables to automatically generate session-level variables. Modifications made to session-level variables apply to the current session only.

    Query system variables

    You can query a system variable by using the following methods:

    MySQL mode
    Oracle mode

    To query the current values of system variables, use the following statements:

    obclient [oceanbase]> SHOW VARIABLES LIKE 'ob_query_timeout';
    
    obclient [oceanbase]> SHOW GLOBAL VARIABLES LIKE 'ob_query_timeout';
    

    To query the modification records and default values of global variables, use the following statement:

    obclient [oceanbase]> SELECT * FROM oceanbase.DBA_OB_SYS_VARIABLES WHERE NAME='ob_query_timeout';
    

    To query the current values of system variables, use the following statements:

    obclient [SYS]> SELECT * FROM SYS.TENANT_VIRTUAL_SESSION_VARIABLE WHERE VARIABLE_NAME = 'ob_query_timeout';
    
    obclient [SYS]> SELECT * FROM SYS.TENANT_VIRTUAL_GLOBAL_VARIABLE WHERE VARIABLE_NAME = 'ob_query_timeout';
    

    To query the modification records and default values of global variables, use the following statement:

    obclient [SYS]> SELECT * FROM SYS.DBA_OB_SYS_VARIABLES WHERE NAME='ob_query_timeout';
    

    Differences between parameters and system variables

    Comparison item Parameter System variable
    Effective scope Effective in a cluster, zone, server, or tenant. Effective globally or at the session level in a tenant.
    Effective mode
    • Dynamically take effect: The value of edit_level is dynamic_effective.
    • Take effect upon restart: The value of edit_level is static_effective.
    • A session-level variable takes effect only on the current session.
    • A global variable does not take effect on the current session and takes effect only on sessions established upon re-login.
    Modification
    • Modification can be performed by using SQL statements, for example,
      ALTER SYSTEM SET schema_history_expire_time='1h';.
    • Modification can be performed by using startup parameters, for example,
      cd /home/admin/oceanbase && ./bin/observer -o "schema_history_expire_time='1h'";.
    Modification can only be performed by using SQL statements. Here are some examples:
    • MySQL mode:
      SET ob_query_timeout = 20000000;
      SET GLOBAL ob_query_timeout = 20000000;
    • Oracle mode:
      ALTER SESSION SET ob_query_timeout = 20000000;
      ALTER SYSTEM SET ob_query_timeout = 20000000;
      or
      SET ob_query_timeout = 20000000;
      SET GLOBAL ob_query_timeout = 20000000;
    Query method You can query a parameter by using the SHOW PARAMETERS statement, for example, SHOW PARAMETERS LIKE 'schema_history_expire_time';. You can query a variable by using the SHOW [GLOBAL] VARIABLES statement. Here are some examples:
    • MySQL mode:
      SHOW VARIABLES LIKE 'ob_query_timeout';
      SHOW GLOBAL VARIABLES LIKE 'ob_query_timeout';
    • Oracle mode:
      SELECT * FROM SYS.TENANT_VIRTUAL_SESSION_VARIABLE WHERE VARIABLE_NAME = 'ob_query_timeout';
      SELECT * FROM SYS.TENANT_VIRTUAL_GLOBAL_VARIABLE WHERE VARIABLE_NAME = 'ob_query_timeout';
    Persistence Parameters are persisted into internal tables and configuration files, and can be queried from the /home/admin/oceanbase/etc/observer.config.bin and /home/admin/oceanbase/etc/observer.config.bin.history files. Only global variables are persisted.
    Lifecycle Long. A parameter remains effective for the entire duration of a process. Short. A system variable takes effect only after the tenant schema is created.

    References

    • For more information about parameters, see Overview of parameters.

    • For more information about how to query and set parameters, see Set parameters.

    • For information about system variables, see Overview of system variables.

    • For more information about how to query and set system variables, see Set variables.

    Previous topic

    General wait events
    Last

    Next topic

    Overview
    Next
    What is on this page
    Parameters
    Categories of parameters
    Query parameters
    System variables
    Categories of system variables
    Query system variables
    Differences between parameters and system variables
    References