Both the system tenant and user tenants can view cluster parameters.
You can view cluster parameters in the following ways:
View cluster parameters by using the
SHOWstatementYou can view all parameters and their descriptions in the cluster except for hidden parameters (parameters in the
_xx_xxformat). If the value of a hidden parameter has been modified to a non-default value, you can also use theSHOWstatement to view it.View cluster parameters by using the
GV$OB_PARAMETERSviewUnlike the
SHOWstatement, theGV$OB_PARAMETERSview allows you to view all parameters in the cluster (including hidden parameters, that is, parameters in the_xx_xxformat) and their descriptions.
For more information about parameters, see Overview of parameters and system variables.
View cluster parameters by using the SHOW statement
Both the system tenant (that is, the sys tenant) and user tenants can use the SHOW statement to view the values of cluster parameters. The system tenant can also specify the TENANT keyword to view the parameter information of a specified tenant.
Log in to the cluster as the system tenant or a user tenant.
The following is an example connection string. Please refer to your actual database configuration when connecting to the database.
obclient -h10.xx.xx.xx -P2883 -utest@mysql#obdemo -p***** -AFor more detailed instructions on how to connect to a database, see Overview of database connections (MySQL-compatible mode) and Overview of database connections (Oracle-compatible mode).
Execute the following statement to view the cluster parameters.
The statement is as follows:
obclient [xxx]> SHOW PARAMETERS [SHOW_PARAM_OPTS] [TENANT = tenant_name];Where:
[SHOW_PARAM_OPTS]can be specified as[LIKE 'pattern' | WHERE expr]. The column attributes that can be specified inWHERE exprare the same as those in the result returned bySHOW PARAMETERS.Specifying the
TENANTkeyword allows you to view the parameter information of a specified tenant.The following is an example of querying parameters for the system tenant or a user tenant.
obclient [(none)]> SHOW PARAMETERS LIKE '%syslog_level%';The query 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 | syslog_level | STRING | WDIAG | specifies the current level of logging. There are DEBUG, TRACE, WDIAG, EDIAG, INFO, WARN, ERROR, seven different log levels. | OBSERVER | CLUSTER | DEFAULT | DYNAMIC_EFFECTIVE | WDIAG | 1 | +-------+----------+----------------+----------+--------------+-----------+-------+------------------------------------------------------------------------------------------------------------------------------+----------+---------+---------+-------------------+---------------+-----------+ 1 row in setThe following example shows how to query the parameters of a specified tenant from the system tenant.
obclient [(none)]> SHOW PARAMETERS LIKE '%syslog_level%' TENANT = mysql001;The query 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 | syslog_level | STRING | WDIAG | specifies the current level of logging. There are DEBUG, TRACE, WDIAG, EDIAG, INFO, WARN, ERROR, seven different log levels. | OBSERVER | CLUSTER | DEFAULT | DYNAMIC_EFFECTIVE | WDIAG | 1 | +-------+----------+----------------+----------+--------------+-----------+-------+------------------------------------------------------------------------------------------------------------------------------+----------+---------+---------+-------------------+---------------+-----------+ 1 row in set
The following table describes the columns in the query result.
ColumnDescriptionzone The zone where the parameter is located. svr_type The server type. svr_ip The IP address of the server. svr_port The port number of the server. name The name of the parameter. data_type The data type of the parameter, for example, STRINGandCAPACITY.value The value of the parameter. Note
When you modify the value of a parameter, you can specify which zones or servers are affected by the change. Therefore, the value of the parameter may be different on different zones or servers.
info The description of the parameter. section The category to which the parameter belongs: SSTABLE: indicates that the parameter is related to SSTables.OBSERVER: indicates that the parameter is related to OBServers.ROOT_SERVICE: indicates that the parameter is related to Root Services.TENANT: indicates that the parameter is related to tenants.TRANS: indicates that the parameter is related to transactions.LOAD_BALANCE: indicates that the parameter is related to load balancing.DAILY_MERGE: indicates that the parameter is related to major compactions.CLOG: indicates that the parameter is related to clogs.LOCATION_CACHE: indicates that the parameter is related to location caching.CACHE: indicates that the parameter is related to caching.RPC: indicates that the parameter is related to RPCs.OBPROXY: indicates that the parameter is related to OBProxies.
scope The scope of the parameter: TENANT: indicates that the parameter is at the tenant level.CLUSTER: indicates that the parameter is at the cluster level.
source The source of the current value: TENANTCLUSTERCMDLINEOBADMINFILEDEFAULT
edit_level Defines the modification behavior of the parameter: READONLY: indicates that the parameter cannot be modified.STATIC_EFFECTIVE: indicates that the parameter can be modified but takes effect only after you restart the OBServer node.DYNAMIC_EFFECTIVE: indicates that the parameter can be modified and takes effect immediately.
default_value The default value of the parameter. isdefault Indicates whether the current value is the default value. - 0: The current value is not the default value.
- 1: The current value is the default value.
View cluster parameters through the GV$OB_PARAMETERS view
Log in to the cluster from the system tenant or a user tenant.
The following is an example of how to connect to a database. Please use the actual environment settings when connecting to the database.
obclient -h10.xx.xx.xx -P2883 -utest@mysql#obdemo -p***** -AFor more information about how to connect to a database, see Overview of database connections (MySQL-compatible mode) and Overview of database connections (Oracle-compatible mode).
Run the following command to enter the
oceanbasedatabase.obclient > USE oceanbase;Note
This step is required only for MySQL tenants. Oracle tenants can skip it.
Run the following command to view the cluster parameters.
The following is an example query:
obclient> SELECT * FROM GV$OB_PARAMETERS WHERE NAME LIKE '%syslog_level%';The query result is as follows:
+----------------+----------+-------+---------+-----------+--------------+-----------+-------+------------------------------------------------------------------------------------------------------------------------------+----------+-------------------+---------------+-----------+ | SVR_IP | SVR_PORT | ZONE | SCOPE | TENANT_ID | NAME | DATA_TYPE | VALUE | INFO | SECTION | EDIT_LEVEL | DEFAULT_VALUE | ISDEFAULT | +----------------+----------+-------+---------+-----------+--------------+-----------+-------+------------------------------------------------------------------------------------------------------------------------------+----------+-------------------+---------------+-----------+ | 172.xx.xxx.xxx | 2882 | zone1 | CLUSTER | NULL | syslog_level | STRING | WDIAG | specifies the current level of logging. There are DEBUG, TRACE, WDIAG, EDIAG, INFO, WARN, ERROR, seven different log levels. | OBSERVER | DYNAMIC_EFFECTIVE | WDIAG | YES | +----------------+----------+-------+---------+-----------+--------------+-----------+-------+------------------------------------------------------------------------------------------------------------------------------+----------+-------------------+---------------+-----------+ 1 row in set
For more information about the GV$OB_PARAMETERS view, see GV$OB_PARAMETERS (MySQL-compatible mode).
References
For more information about cluster parameters, see the following topics:
For detailed information about each parameter, see Overview of parameters and system variables.
