You can set system variables to make OceanBase AI 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
rootuser.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
SHOWstatement.The syntax is as follows:
SHOW [SESSION | GLOBAL] VARIABLES [LIKE 'pattern' | WHERE expr]where:
SESSION | GLOBAL:SESSIONindicates session variables, andGLOBALindicates global variables. If you do not specify this parameter, session variables are queried by default.pattern: the keyword of the variable.
Here are some examples:
Query the session-level variable
ob_query_timeout.obclient [oceanbase]> SHOW VARIABLES LIKE 'ob_query_timeout';Alternatively,
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 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 therootuser.obclient -P2881 -h172.30.xx.xx -uroot@mysql001#cluster -p**** -A -DoceanbaseAccess the database named
oceanbase.obclient [(none)]> USE oceanbase;Query variable values by using views.
Query the value of the session-level variable
ob_query_timeoutfrom 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 global-level variable
ob_query_timeoutfrom 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_timeoutvariable from theDBA_OB_SYS_VARIABLESview.obclient [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 | +----------------------------+----------------------------+------------------+----------+-----------+-----------+------------------+----------------------------------+---------------+-----------+ | 2024-05-08 14:22:06.882646 | 2024-05-08 14:22:06.882646 | ob_query_timeout | 10000000 | | | GLOBAL | SESSION | Query timeout in microsecond(us) | 10000000 | YES | +----------------------------+----------------------------+------------------+----------+-----------+-----------+------------------+----------------------------------+---------------+-----------+ 1 row in set
References
For more information about system variables, see: