配置 AlloyDB Omni 数据库参数

选择文档版本:

如需为 AlloyDB Omni 配置数据库参数,您可以在以下任一位置更新全局统一配置 (GUC) 参数

  • postgresql.conf 文件,适用于在虚拟机上运行 AlloyDB Omni 的环境。

使用 RPM 在 AlloyDB Omni 中更新参数

在采用 RPM 安装的 AlloyDB Omni 中,您可以通过修改 postgresql.conf 文件来更新参数,如下所示:

  1. 找到用于 AlloyDB Omni 安装的 postgresql.conf 配置文件。

  2. 使用文本编辑器在 postgresql.conf 中添加或更新数据库标志。

    例如,如需强制执行密码到期,请在 postgresql.conf 文件中设置以下标志:

    password.enforce_expiration = ON
    
  3. 添加或修改数据库标志后,请通过重启 AlloyDB Omni 服务来重新加载 postgresql.conf 文件,以使更改生效:

    sudo systemctl restart alloydbomni18