Purpose
You can use this statement to modify parameters.
Note
The cluster-level parameters can be modified only in the sys tenant.
Syntax
ALTER SYSTEM [SET] parameter_name = expression [SCOPE = {MEMORY | SPFILE | BOTH}]
[COMMENT [=] 'text'][SERVER [=] 'ip:port' | ZONE [=] 'zone'];
Parameters
| Parameter | Description |
|---|---|
| parameter_name | The name of the parameter to be modified. |
| expression | The value of the parameter after modification. |
| COMMENT | Adds a comment on the modification. This parameter is optional. We recommend that you specify this parameter. |
| SCOPE | The effective scope of the parameter modification. Valid values:
|
| SERVER | Specifies to modify only a parameter of the specified server instance. |
| ZONE | Specifies to modify the parameter for servers of the specified type in the specified cluster. If this parameter is not specified, the modification applies to servers of the specified type in all clusters. |
Note
- When you modify multiple parameters at a time, separate the parameters with commas (,).
- You can use the following statement to view system parameters:
SHOW PARAMETERS [LIKE 'pattern' | WHERE expr];.
Examples
Modify the enable_sql_audit parameter.
obclient> SHOW PARAMETERS LIKE 'ENABLE_SQL_AUDIT';
+------+----------+---------------+----------+------------------+-----------+-------+---------------------------------------------------------------------------------------------------------------+----------+---------+---------+-------------------+
| zone | svr_type | svr_ip | svr_port | name | data_type | value | info | section | scope | source | edit_level |
+------+----------+---------------+----------+------------------+-----------+-------+---------------------------------------------------------------------------------------------------------------+----------+---------+---------+-------------------+
| z1 | observer | xx.xx.xxx.xx1 | xxxxx | enable_sql_audit | NULL | True | specifies whether SQL audit is turned on. The default value is TRUE. Value: TRUE: turned on FALSE: turned off | OBSERVER | CLUSTER | DEFAULT | DYNAMIC_EFFECTIVE |
+------+----------+---------------+----------+------------------+-----------+-------+---------------------------------------------------------------------------------------------------------------+----------+---------+---------+-------------------+
1 rows in set
obclient> ALTER SYSTEM SET ENABLE_SQL_AUDIT = FALSE SCOPE = BOTH;
Query OK, 0 rows affected
obclient> SHOW PARAMETERS LIKE 'ENABLE_SQL_AUDIT';
+------+----------+---------------+----------+------------------+-----------+-------+---------------------------------------------------------------------------------------------------------------+----------+---------+---------+-------------------+
| zone | svr_type | svr_ip | svr_port | name | data_type | value | info | section | scope | source | edit_level |
+------+----------+---------------+----------+------------------+-----------+-------+---------------------------------------------------------------------------------------------------------------+----------+---------+---------+-------------------+
| z1 | observer | xx.xx.xxx.xx1 | xxxxx | enable_sql_audit | NULL | False | specifies whether SQL audit is turned on. The default value is TRUE. Value: TRUE: turned on FALSE: turned off | OBSERVER | CLUSTER | DEFAULT | DYNAMIC_EFFECTIVE |
+------+----------+---------------+----------+------------------+-----------+-------+---------------------------------------------------------------------------------------------------------------+----------+---------+---------+-------------------+
1 rows in set