You can set system variables to make OceanBase Database behave according to your business requirements. This topic describes how to view tenant system variables.
View tenant system variables by using the SHOW statement
Log in to the user tenant of the cluster as the root user.
Take the
mq_t1tenant as an example:obclient -h172.30.xx.xx -P2883 -uroot@mq_t1#cluster -p**** -AQuery system variable information by using the SHOW statement.
The syntax is as follows:
SHOW [SESSION | GLOBAL] VARIABLES [LIKE 'pattern' | WHERE expr]Parameter description:
SESSION | GLOBAL: SESSION indicates session variables, and GLOBAL indicates global variables. If not specified, session variables are viewed by default.pattern: The keyword for the variable.
Examples:
Query the session-level variable
ob_query_timeout.obclient [oceanbase]> SHOW VARIABLES LIKE 'ob_query_timeout';or
obclient [oceanbase]> SHOW SESSION VARIABLES LIKE 'ob_query_timeout';The query result is as follows:
+------------------+-------------+ | Variable_name | Value | +------------------+-------------+ | ob_query_timeout | 10000000 | +------------------+-------------+ 1 row in setQuery the global-level variable
ob_query_timeout.obclient [oceanbase]> SHOW GLOBAL VARIABLES WHERE variable_name LIKE 'ob_query_timeout';The query result is as follows:
+------------------+-------------+ | Variable_name | Value | +------------------+-------------+ | ob_query_timeout | 10000000 | +------------------+-------------+ 1 row in set
View tenant system variables by using a view
Log in to the
mysql001tenant of the cluster as the root user.obclient -P2881 -h172.30.xx.xx -uroot@mysql001#cluster -p**** -A -DoceanbaseEnter the
oceanbasedatabase.obclient [(none)]> USE oceanbase;Query variable values through views.
Query the value of the
ob_query_timeoutsession-level variable through theINFORMATION_SCHEMA.SESSION_VARIABLESview.obclient [oceanbase]> SELECT * FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME = 'ob_query_timeout';The query result is as follows:
+------------------+----------------+ | VARIABLE_NAME | VARIABLE_VALUE | +------------------+----------------+ | ob_query_timeout | 10000000 | +------------------+----------------+ 1 row in setQuery the value of the
ob_query_timeoutglobal-level variable through theINFORMATION_SCHEMA.GLOBAL_VARIABLESview.obclient [oceanbase]> SELECT * FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME = 'ob_query_timeout';The query result is as follows:
+------------------+----------------+ | VARIABLE_NAME | VARIABLE_VALUE | +------------------+----------------+ | ob_query_timeout | 10000000 | +------------------+----------------+ 1 row in setQuery the modification history and default value of the
ob_query_timeoutglobal-level variable through theDBA_OB_SYS_VARIABLESview.obclient(root@mysql001)[oceanbase]> SELECT * FROM oceanbase.DBA_OB_SYS_VARIABLES WHERE NAME = 'ob_query_timeout';The query result is as follows:
+----------------------------+----------------------------+------------------+----------+-----------+-----------+------------------+----------------------------------+---------------+-----------+ | CREATE_TIME | MODIFY_TIME | NAME | VALUE | MIN_VALUE | MAX_VALUE | SCOPE | INFO | DEFAULT_VALUE | ISDEFAULT | +----------------------------+----------------------------+------------------+----------+-----------+-----------+------------------+----------------------------------+---------------+-----------+ | 2026-06-24 17:34:34.281941 | 2026-06-24 17:34:34.281941 | ob_query_timeout | 10000000 | | | GLOBAL | SESSION | Query timeout in microsecond(us) | 10000000 | YES | +----------------------------+----------------------------+------------------+----------+-----------+-----------+------------------+----------------------------------+---------------+-----------+ 1 row in setQuery the modification history of the
ob_query_timeoutglobal-level variable through theDBA_OB_SYS_VARIABLE_HISTORYview.obclient(root@mysql001)[oceanbase]> SELECT * FROM oceanbase.DBA_OB_SYS_VARIABLE_HISTORY WHERE NAME = 'ob_query_timeout';The query result is as follows:
+------------------+----------+----------------------------+ | NAME | VALUE | MODIFY_TIME | +------------------+----------+----------------------------+ | ob_query_timeout | 10000000 | 2026-06-24 17:34:34.323366 | +------------------+----------+----------------------------+ 1 row in set
Log in to the
oracle001tenant of the cluster as theSYSuser.obclient -h172.30.xx.xx -P2883 -usys@oracle001#cluster -p**** -AQuery variable values through views.
Query the session-level value of
ob_query_timeoutfrom theSYS.TENANT_VIRTUAL_SESSION_VARIABLEview.obclient [SYS]> SELECT * FROM SYS.TENANT_VIRTUAL_SESSION_VARIABLE WHERE VARIABLE_NAME = 'ob_query_timeout'; +------------------+----------+ | VARIABLE_NAME | VALUE | +------------------+----------+ | ob_query_timeout | 10000000 | +------------------+----------+ 1 row in setQuery the global-level value of
ob_query_timeoutfrom theSYS.TENANT_VIRTUAL_GLOBAL_VARIABLEview.obclient [SYS]> SELECT * FROM SYS.TENANT_VIRTUAL_GLOBAL_VARIABLE WHERE VARIABLE_NAME = 'ob_query_timeout'; +------------------+----------+ | VARIABLE_NAME | VALUE | +------------------+----------+ | ob_query_timeout | 10000000 | +------------------+----------+ 1 row in setQuery changes and the default value of the global-level
ob_query_timeoutvariable from theDBA_OB_SYS_VARIABLESview.obclient(sys@oracle001)[SYS]> SELECT * FROM SYS.DBA_OB_SYS_VARIABLES WHERE NAME = 'ob_query_timeout';The query result is as follows:
+------------------------------+------------------------------+------------------+----------+-----------+-----------+------------------+----------------------------------+---------------+-----------+ | CREATE_TIME | MODIFY_TIME | NAME | VALUE | MIN_VALUE | MAX_VALUE | SCOPE | INFO | DEFAULT_VALUE | ISDEFAULT | +------------------------------+------------------------------+------------------+----------+-----------+-----------+------------------+----------------------------------+---------------+-----------+ | 24-JUN-26 05.34.44.348961 PM | 24-JUN-26 05.34.44.348961 PM | ob_query_timeout | 10000000 | NULL | NULL | GLOBAL | SESSION | Query timeout in microsecond(us) | 10000000 | YES | +------------------------------+------------------------------+------------------+----------+-----------+-----------+------------------+----------------------------------+---------------+-----------+ 1 row in setQuery the modification history of the global-level
ob_query_timeoutvariable from theDBA_OB_SYS_VARIABLE_HISTORYview.obclient(sys@oracle001)[SYS]> SELECT * FROM SYS.DBA_OB_SYS_VARIABLE_HISTORY WHERE NAME = 'ob_query_timeout';The query result is as follows:
+------------------+----------+------------------------------+ | NAME | VALUE | MODIFY_TIME | +------------------+----------+------------------------------+ | ob_query_timeout | 10000000 | 24-JUN-26 05.34.44.384848 PM | +------------------+----------+------------------------------+ 1 row in set
References
For more information about system variables, see:
