View system variables
You can set system variables to make seekdb behave as required by your business. This topic describes how to view system variables.
View system variables by using SHOW statements
-
Log in to seekdb.
The following example shows how to connect to the database. Replace the placeholder with the actual values in your environment.
mysql -h127.xx.xx.xx -P2881 -uroot -p***** -A -
Query the system variable information by using SHOW statements.
The syntax is as follows:
SHOW [SESSION | GLOBAL] VARIABLES [LIKE 'pattern' | WHERE expr]The parameters are described as follows:
SESSION | GLOBAL: SESSION indicates a session variable, and GLOBAL indicates a global variable. If you do not specify this parameter, the session variables are displayed by default.pattern: the keyword of the variable.
Here are some examples:
-
Query the session variable
ob_query_timeout.SHOW VARIABLES LIKE 'ob_query_timeout';or
SHOW SESSION VARIABLES LIKE 'ob_query_timeout';The query result is as follows:
+------------------+-------------+
| Variable_name | Value |
+------------------+-------------+
| ob_query_timeout | 10000000 |
+------------------+-------------+
1 row in set -
Query the global variable
ob_query_timeout.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 system variables by using views
-
Log in to seekdb.
The following example shows how to connect to the database. Replace the placeholder with the actual values in your environment.
mysql -h127.xx.xx.xx -P2881 -uroot -p***** -A -
Switch to the
oceanbasedatabase.USE oceanbase; -
Query the variable value by using a view.
-
Query the session variable
ob_query_timeoutfrom theINFORMATION_SCHEMA.SESSION_VARIABLESview.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 set -
Query the global variable
ob_query_timeoutfrom theINFORMATION_SCHEMA.GLOBAL_VARIABLESview.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 set -
Query the modification status and default value of the
ob_query_timeoutvariable from theDBA_OB_SYS_VARIABLESview.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 |
+----------------------------+----------------------------+------------------+----------+-----------+-----------+------------------+----------------------------------+---------------+-----------+
| 2025-11-19 16:55:28.311760 | 2025-11-19 16:55:28.311760 | ob_query_timeout | 10000000 | | | GLOBAL | SESSION | Query timeout in microsecond(us) | 10000000 | YES |
+----------------------------+----------------------------+------------------+----------+-----------+-----------+------------------+----------------------------------+---------------+-----------+
1 row in set
-