描述
该语句用来修改配置项信息。
说明
仅支持在 sys 租户中修改集群级配置项。
语法
ALTER SYSTEM [SET] parameter_name = expression [SCOPE = {MEMORY | SPFILE | BOTH}]
[COMMENT [=] 'text'][SERVER [=] 'ip:port' | ZONE [=] 'zone' | TENANT [=] 'tenant'];
参数解释
| 参数 | 描述 |
|---|---|
| parameter_name | 指定要修改的配置项名称。 |
| expression | 指定修改后的配置项的值。 |
| COMMENT | 用于添加关于本次修改的注释。该参数为可选,建议不要省略。 |
| SCOPE | 指定本次配置项修改的生效范围。它的值主要有以下三种:
SCOPE 默认值为 BOTH。对于不能立即生效的配置项,如果使用 BOTH 或 MEMORY 会报错 。 |
| SERVER | 只修改指定 Server 实例的某个配置项。 |
| ZONE | 表明本配置项的修改针对指定集群的指定 Server 类型,否则,针对所有集群的指定 Server 类型。 |
| TENANT | 指定需要修改租户级配置项的租户,默认当前租户。通过系统租户修改指定租户的租户级配置项时需要添加该参数。租户级配置项清单,请参见 租户级别配置项。 |
说明
- 同时修改多个系统配置项时,以逗号(,)分隔。
- 查看系统配置项的格式为
SHOW PARAMETERS [LIKE 'pattern' | WHERE expr];。
示例
修改配置项
enable_sql_audit的信息。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修改 tenant 租户的租户级配置项
connection_control_max_connection_delay。obclient> SHOW PARAMETERS LIKE 'connection_control_max_connection_delay' TENANT = 'tenant'; +-------+----------+----------------+----------+-----------------------------------------+-----------+------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------+----------+--------+---------+-------------------+ | zone | svr_type | svr_ip | svr_port | name | data_type | value | info | section | scope | source | edit_level | +-------+----------+----------------+----------+-----------------------------------------+-----------+------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------+----------+--------+---------+-------------------+ | zone1 | observer | xx.xx.xx.218 | 2882 | connection_control_max_connection_delay | NULL | 2147483647 | The maximum delay in milliseconds for server response to failed connection attempts, if connection_control_failed_connections_threshold is greater than zero | OBSERVER | TENANT | DEFAULT | DYNAMIC_EFFECTIVE | +-------+----------+----------------+----------+-----------------------------------------+-----------+------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------+----------+--------+---------+-------------------+ obclient> ALTER SYSTEM SET connection_control_max_connection_delay = 2147483646 TENANT = 'tenant'; obclient> SHOW PARAMETERS LIKE 'connection_control_max_connection_delay' TENANT = 'tenant'; +-------+----------+----------------+----------+-----------------------------------------+-----------+------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------+----------+--------+---------+-------------------+ | zone | svr_type | svr_ip | svr_port | name | data_type | value | info | section | scope | source | edit_level | +-------+----------+----------------+----------+-----------------------------------------+-----------+------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------+----------+--------+---------+-------------------+ | zone1 | observer | xx.xx.xx.218 | 2882 | connection_control_max_connection_delay | NULL | 2147483646 | The maximum delay in milliseconds for server response to failed connection attempts, if connection_control_failed_connections_threshold is greater than zero | OBSERVER | TENANT | DEFAULT | DYNAMIC_EFFECTIVE | +-------+----------+----------------+----------+-----------------------------------------
「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。




