You can set system variables to ensure that the behaviors of OceanBase Database meet the service requirements. This topic describes how to view system variables of a tenant.
Use the SHOW statement to view system variables of a tenant
Log on to a user tenant of the cluster as the root user.
To log on to the
mq_t1tenant, run the following command:obclient -h172.30.xx.xx -P2883 -uroot@mq_t1#cluster -p**** -AExecute the SHOW statement to query the system variables.
The syntax is as follows:
SHOW [SESSION | GLOBAL] VARIABLES [LIKE 'pattern' | WHERE expr]The parameters are described as follows:
SESSION | GLOBAL:SESSIONspecifies to view session variables andGLOBALspecifies to view global variables. If you do not specify any keyword, session variables are displayed by default.pattern: a variable keyword.
Here are some examples:
To query the session variables of the
ob_query_timeouttenant, execute the following statement:obclient [oceanbase]> SHOW VARIABLES LIKE 'ob_query_timeout'; +------------------+-------------+ | Variable_name | Value | +------------------+-------------+ | ob_query_timeout | 10000000 | +------------------+-------------+ 1 row in set # Or obclient [oceanbase]> SHOW SESSION VARIABLES LIKE 'ob_query_timeout'; +------------------+-------------+ | Variable_name | Value | +------------------+-------------+ | ob_query_timeout | 10000000 | +------------------+-------------+ 1 row in setTo query the global variables of the
ob_query_timeouttenant, execute the following statement:obclient [oceanbase]> SHOW GLOBAL VARIABLES WHERE variable_name LIKE 'ob_query_timeout'; +------------------+-------------+ | Variable_name | Value | +------------------+-------------+ | ob_query_timeout | 10000000 | +------------------+-------------+ 1 row in set
Query views for system variables of a tenant
MySQL mode
Log on to the
mysql001tenant of the cluster as the root user.obclient -P2881 -h172.30.xx.xx -uroot@mysql001#cluster -p**** -A -DoceanbaseAccess the database named
oceanbase.obclient [(none)]> USE oceanbase;Query views for variable values.
Query the
INFORMATION_SCHEMA.SESSION_VARIABLESview for the values of session variables of theob_query_timeouttenant.obclient [oceanbase]> SELECT * FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME = 'ob_query_timeout'; +------------------+----------------+ | VARIABLE_NAME | VARIABLE_VALUE | +------------------+----------------+ | ob_query_timeout | 10000000 | +------------------+----------------+ 1 row in setQuery the
INFORMATION_SCHEMA.GLOBAL_VARIABLESview for the values of global variables of theob_query_timeouttenant.obclient [oceanbase]> SELECT * FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME = 'ob_query_timeout'; +------------------+----------------+ | VARIABLE_NAME | VARIABLE_VALUE | +------------------+----------------+ | ob_query_timeout | 10000000 | +------------------+----------------+ 1 row in set
Oracle mode
Log on to the
oracle001tenant of the cluster as the SYS user.obclient -h172.30.xx.xx -P2883 -usys@oracle001#cluster -p**** -AQuery views for variable values.
Query the
SYS.TENANT_VIRTUAL_SESSION_VARIABLEview for the values of session variables of theob_query_timeouttenant.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
SYS.TENANT_VIRTUAL_GLOBAL_VARIABLEview for the values of global variables of theob_query_timeouttenant.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 set
References
For more information about system variables, visit the following links: