From df3f47bab783a25dd7a7aed49a8bec6183156225 Mon Sep 17 00:00:00 2001 From: liyang0608 <264327807@qq.com> Date: Thu, 6 Aug 2020 09:33:21 +0800 Subject: [PATCH] new feature --- .../docs/Developerguide/ALTER-SYSTEM-SET.md | 52 +++++++++ ...66\350\241\250\345\207\275\346\225\260.md" | 92 +++++++++++++++ ...57\346\234\215\345\212\241\345\231\250.md" | 65 ++++++++++- ...43\347\240\201\347\244\272\344\276\213.md" | 106 ++++++++++++++++++ ...21\345\231\250\345\207\275\346\225\260.md" | 30 +++-- ...15\350\256\276\345\217\202\346\225\260.md" | 53 +++++---- content/zh/menu/index.md | 14 ++- 7 files changed, 371 insertions(+), 41 deletions(-) create mode 100644 content/zh/docs/Developerguide/ALTER-SYSTEM-SET.md create mode 100644 "content/zh/docs/Developerguide/\345\205\250\345\261\200\344\270\264\346\227\266\350\241\250\345\207\275\346\225\260.md" create mode 100644 "content/zh/docs/Developerguide/\347\244\272\344\276\213-\351\200\273\350\276\221\345\244\215\345\210\266\344\273\243\347\240\201\347\244\272\344\276\213.md" diff --git a/content/zh/docs/Developerguide/ALTER-SYSTEM-SET.md b/content/zh/docs/Developerguide/ALTER-SYSTEM-SET.md new file mode 100644 index 000000000..6335ac6da --- /dev/null +++ b/content/zh/docs/Developerguide/ALTER-SYSTEM-SET.md @@ -0,0 +1,52 @@ +# ALTER SYSTEM SET + +## 功能描述 + +ALTER SYSTEM SET命令用于设置POSTMASTER、SIGHUP、BACKEND级别的GUC参数。此命令会将参数写入配置文件,不同级别生效方式有所不同。 + +## 注意事项 + +- 此命令仅拥有管理员权限的用户才可使用。 +- 不同级别GUC参数生效时间如下: + - POSTMASTER级别的GUC参数需要重启后才生效。 + - BACKEND级别的GUC参数需要会话重新连接后才生效。 + - SIGHUP级别的GUC参数立即生效(需要等待线程重新加载参数,实际略微有延迟)。 + +- 通过配置 [audit\_set\_parameter](zh-cn_topic_0242371537.md#zh-cn_topic_0237124747_zh-cn_topic_0059777487_sc59738d0efe94f909306fde1f3d04f1e) 参数,可以配置此操作是否被审计。 +- 操作可被备机同步。 + +## 语法格式 + +``` +ALTER SYSTEM SET parameter TO value; +``` + +## 参数说明 + +- **parameter** + + GUC参数名。 + +- **value** + + GUC参数值。 + + +## 示例 + +``` +--设置SIGHUP级别参数audit_enabled。 +postgres=# alter system set audit_enabled to off; +ALTER SYSTEM SET +postgres=# show audit_enabled; + audit_enabled +--------------- + off +(1 row) + +--设置POSTMASTER级别参数 enable_thread_pool,将在重启之后生效。 +postgres=# alter system set enable_thread_pool to on; +NOTICE: please restart the database for the POSTMASTER level parameter to take effect. +ALTER SYSTEM SET +``` + diff --git "a/content/zh/docs/Developerguide/\345\205\250\345\261\200\344\270\264\346\227\266\350\241\250\345\207\275\346\225\260.md" "b/content/zh/docs/Developerguide/\345\205\250\345\261\200\344\270\264\346\227\266\350\241\250\345\207\275\346\225\260.md" new file mode 100644 index 000000000..68599d25b --- /dev/null +++ "b/content/zh/docs/Developerguide/\345\205\250\345\261\200\344\270\264\346\227\266\350\241\250\345\207\275\346\225\260.md" @@ -0,0 +1,92 @@ +# 全局临时表函数 + +- pg\_get\_gtt\_relstats\(relOid\) + + 描述:显示当前会话指定的全局临时表的基本信息。 + + 参数:全局临时表的OID。 + + 返回值类型:record + + 示例: + + ``` + postgres=# select * from pg_get_gtt_relstats(74069); + relfilenode | relpages | reltuples | relallvisible | relfrozenxid | relminmxid + -------------+----------+-----------+---------------+--------------+------------ + 74069 | 58 | 13000 | 0 | 11151 | 0 + (1 row) + ``` + + +- pg\_get\_gtt\_statistics\(relOid, attnum, ''::text\) + + 描述:显示当前会话指定的全局临时表的单列统计信息。 + + 参数:全局临时表的OID和属性attnum。 + + 返回值类型:record + + 示例: + + ``` + postgres=# select * from pg_get_gtt_statistics(74069,1,''::text); + starelid | starelkind | staattnum | stainherit | stanullfrac | stawidth | stadistinct | stakind1 | stakind2 | stakind3 | stakind4 | stakind5 | staop1 | staop2 | staop3 | staop4 | staop5 | stanumbers1 | stanumbers2 | stanumbers3 | stanu + mbers4 | stanumbers5 | + stavalues1 + | stavalues2 | stavalues3 | stavalues4 | stavalues5 | stadndistinct | staextinfo + ----------+------------+-----------+------------+-------------+----------+-------------+----------+----------+----------+----------+----------+--------+--------+--------+--------+--------+-------------+-------------+-------------+------ + -------+-------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + ------------------------------------------------------------------------+------------+------------+------------+------------+---------------+------------ + 74069 | c | 1 | f | 0 | 4 | -1 | 2 | 3 | 0 | 0 | 0 | 97 | 97 | 0 | 0 | 0 | | {1} | | + | | {1,130,260,390,520,650,780,910,1040,1170,1300,1430,1560,1690,1820,1950,2080,2210,2340,2470,2600,2730,2860,2990,3120,3250,3380,3510,3640,3770,3900,4030,4160,4290,4420,4550,4680,4810,4940,5070,5200,5330,5460,5590,57 + 20,5850,5980,6110,6240,6370,6500,6630,6760,6890,7020,7150,7280,7410,7540,7670,7800,7930,8060,8190,8320,8450,8580,8710,8840,8970,9100,9230,9360,9490,9620,9750,9880,10010,10140,10270,10400,10530,10660,10790,10920,11050,11180,11310,11440,1 + 1570,11700,11830,11960,12090,12220,12350,12480,12610,12740,12870,13000} | | | | | 0 | + (1 row) + ``` + + +- pg\_gtt\_attached\_pid\(relOid\) + + 描述:显示正在使用指定全局临时表的所有线程pid。 + + 参数:全局临时表的OID。 + + 返回值类型:record + + 示例: + + ``` + postgres=# select * from pg_gtt_attached_pid(74069); + relid | pid + -------+----------------- + 74069 | 139648170456832 + 74069 | 139648123270912 + (2 rows) + ``` + + +- pg\_list\_gtt\_relfrozenxids\(\) + + 描述:显示各会话的冻结事务xid。 + + pid=0的行,显示所有会话中最老的冻结事务xid。 + + 参数:无。 + + 返回值类型:record + + 示例: + + ``` + postgres=# select * from pg_list_gtt_relfrozenxids(); + pid | relfrozenxid + -----------------+-------------- + 139648123270912 | 11151 + 139648170456832 | 11155 + 0 | 11151 + (3 rows) + ``` + + diff --git "a/content/zh/docs/Developerguide/\345\217\221\351\200\201\347\253\257\346\234\215\345\212\241\345\231\250.md" "b/content/zh/docs/Developerguide/\345\217\221\351\200\201\347\253\257\346\234\215\345\212\241\345\231\250.md" index d2b806b69..41e4aae9a 100644 --- "a/content/zh/docs/Developerguide/\345\217\221\351\200\201\347\253\257\346\234\215\345\212\241\345\231\250.md" +++ "b/content/zh/docs/Developerguide/\345\217\221\351\200\201\347\253\257\346\234\215\345\212\241\345\231\250.md" @@ -2,12 +2,12 @@ ## max\_wal\_senders -**参数说明:**指定事务日志发送进程的并发连接最大数量。不可大于等于[max\_connections](连接设置.md#zh-cn_topic_0237124695_zh-cn_topic_0059777636_sa723b719fa70453bb7ec27f323d41c79)。 +**参数说明:**指定事务日志发送进程的并发连接最大数量。不可大于等于[max\_connections](zh-cn_topic_0242371485.md#zh-cn_topic_0237124695_zh-cn_topic_0059777636_sa723b719fa70453bb7ec27f323d41c79)。 该参数属于POSTMASTER类型参数,请参考[表1](重设参数.md#zh-cn_topic_0237121562_zh-cn_topic_0059777490_t91a6f212010f4503b24d7943aed6d846)中对应设置方法进行设置。 ->![](public_sys-resources/icon-notice.gif) **须知:** ->[wal\_level](设置.md#zh-cn_topic_0237124707_zh-cn_topic_0059778393_s2c76f5957066407a959191148f2c780f)必须设置为archive或者hot\_standby以允许备机的连接。 +>![](public_sys-resources/icon-notice.gif) **须知:** +>[wal\_level](zh-cn_topic_0242371497.md#zh-cn_topic_0237124707_zh-cn_topic_0059778393_s2c76f5957066407a959191148f2c780f)必须设置为archive或者hot\_standby以允许备机的连接。 **取值范围**:整型,0~262143 @@ -35,14 +35,67 @@ 该参数属于SIGHUP类型参数,请参考[表1](重设参数.md#zh-cn_topic_0237121562_zh-cn_topic_0059777490_t91a6f212010f4503b24d7943aed6d846)中对应设置方法进行设置。 ->![](public_sys-resources/icon-notice.gif) **须知:** ->- 如果主机数据较大,重建备机数据库时需要增大此参数的值,主机数据在 500G时,此参数的参考值为 600s。 ->- 此值不能大于wal\_receiver\_timeout或数据库重建时的超时参数。 +>![](public_sys-resources/icon-notice.gif) **须知:** +>- 如果主机数据较大,重建备机数据库时需要增大此参数的值,主机数据在 500G时,此参数的参考值为 600s。 +>- 此值不能大于wal\_receiver\_timeout或数据库重建时的超时参数。 **取值范围:**整型, 0 \~ INT\_MAX,单位为毫秒(ms)。 **默认值:6**s +## max\_replication\_slots + +**参数说明:**设置主机端的日志复制slot个数。 + +该参数属于POSTMASTER类型参数,请参考[表1](重设参数.md#zh-cn_topic_0237121562_zh-cn_topic_0059777490_t91a6f212010f4503b24d7943aed6d846)中对应设置方法进行设置。 + +**取值范围:**整型, 8\~100。 + +**默认值:8** + +**设置建议**: + +使用逻辑解码时,该参数值建议设为:当前物理流复制槽数+所需的逻辑复制槽数。 + +- 物理流复制槽提供了一种自动化的方法来确保主节点在所有备节点或从备节点收到xlog之前,xlog不会被移除。也就是说物理流复制槽用于支撑集群HA。集群所需要的物理流复制槽数为备节点加从备的和与主节点之间的比例。例如,假设集群高可用方案为1主、1备、1从备,则所需物理流复制槽数为2。假设集群的高可用方案为1主3备,则所需物理流复制槽数为3。 +- 关于逻辑复制槽数,请按如下规则考虑: + - 一个逻辑复制槽只能解码一个数据库的修改,如果需要解码多个数据库,则需要创建多个逻辑复制槽。 + - 如果需要多路逻辑复制同步给多个目标数据库,在源端数据库需要创建多个逻辑复制槽,每个逻辑复制槽对应一条逻辑复制链路。 + + +## enable\_slot\_log + +**参数说明**:是否开启逻辑复制槽主备同步特性。 + +该参数属于USERSET类型参数,请参考[表1](重设参数.md#zh-cn_topic_0237121562_zh-cn_topic_0059777490_t91a6f212010f4503b24d7943aed6d846)中对应设置方法进行设置。 + +**取值范围**:布尔型 + +- on表示开启逻辑复制槽主备同步特性。 +- off表示不开启逻辑复制槽主备同步特性。 + +**默认值**:**off** + +## max\_changes\_in\_memory + +**参数说明**:逻辑解码时单条事务在内存中缓存的大小上限,单位字节。 + +该参数属于POSTMASTER类型参数,请参考[表1](重设参数.md#zh-cn_topic_0237121562_zh-cn_topic_0059777490_t91a6f212010f4503b24d7943aed6d846)中对应设置方法进行设置。 + +**取值范围**:整型,1\~2147483647‬ + +**默认值**:**4096** + +## max\_cached\_tuplebufs + +**参数说明**:逻辑解码时总元组信息在内存中缓存的大小上限,单位字节。建议设置为[max\_changes\_in\_memory](#section16366164213497)的两倍以上。 + +该参数属于POSTMASTER类型参数,请参考[表1](重设参数.md#zh-cn_topic_0237121562_zh-cn_topic_0059777490_t91a6f212010f4503b24d7943aed6d846)中对应设置方法进行设置。 + +**取值范围**:整型,1\~2147483647‬ + +**默认值**:**8192** + ## replconninfo1 **参数说明:**设置本端监听和鉴权的第一个节点信息。 diff --git "a/content/zh/docs/Developerguide/\347\244\272\344\276\213-\351\200\273\350\276\221\345\244\215\345\210\266\344\273\243\347\240\201\347\244\272\344\276\213.md" "b/content/zh/docs/Developerguide/\347\244\272\344\276\213-\351\200\273\350\276\221\345\244\215\345\210\266\344\273\243\347\240\201\347\244\272\344\276\213.md" new file mode 100644 index 000000000..66d5c1780 --- /dev/null +++ "b/content/zh/docs/Developerguide/\347\244\272\344\276\213-\351\200\273\350\276\221\345\244\215\345\210\266\344\273\243\347\240\201\347\244\272\344\276\213.md" @@ -0,0 +1,106 @@ +# 示例:逻辑复制代码示例 + +下面示例演示如何通过JDBC接口使用逻辑复制功能的过程。 + +``` +//逻辑复制功能示例:文件名,LogicalReplicationDemo.java +//前提条件:添加JDBC用户机器IP到数据库白名单里,在pg_hba.conf添加以下内容即可: +//假设JDBC用户IP为10.10.10.10 +//host all all 10.10.10.10/32 sha256 +//host replication all 10.10.10.10/32 sha256 + +import org.postgresql.PGProperty; +import org.postgresql.jdbc.PgConnection; +import org.postgresql.replication.LogSequenceNumber; +import org.postgresql.replication.PGReplicationStream; + +import java.nio.ByteBuffer; +import java.sql.DriverManager; +import java.util.Properties; +import java.util.concurrent.TimeUnit; + +public class LogicalReplicationDemo { + public static void main(String[] args) { + String driver = "org.postgresql.Driver"; + //此处配置数据库IP以及端口, + String sourceURL = "jdbc:postgresql://$ip:$port/postgres"; + PgConnection conn = null; + //默认逻辑复制槽的名称是:replication_slot + //测试模式:创建逻辑复制槽 + int TEST_MODE_CREATE_SLOT = 1; + //测试模式:开启逻辑复制(前提条件是逻辑复制槽已经存在) + int TEST_MODE_START_REPL = 2; + //测试模式:删除逻辑复制槽 + int TEST_MODE_DROP_SLOT = 3; + //开启不同的测试模式 + int testMode = TEST_MODE_START_REPL; + + try { + Class.forName(driver); + } catch (Exception e) { + e.printStackTrace(); + return; + } + + try { + Properties properties = new Properties(); + PGProperty.USER.set(properties, "user"); + PGProperty.PASSWORD.set(properties, "passwd"); + //对于逻辑复制,以下三个属性是必须配置项 + PGProperty.ASSUME_MIN_SERVER_VERSION.set(properties, "9.4"); + PGProperty.REPLICATION.set(properties, "database"); + PGProperty.PREFER_QUERY_MODE.set(properties, "simple"); + conn = (PgConnection) DriverManager.getConnection(sourceURL, properties); + System.out.println("connection success!"); + + if(testMode == TEST_MODE_CREATE_SLOT){ + conn.getReplicationAPI() + .createReplicationSlot() + .logical() + .withSlotName("replication_slot") + .withOutputPlugin("test_decoding") + .make(); + }else if(testMode == TEST_MODE_START_REPL) { + //开启此模式前需要创建复制槽 + LogSequenceNumber waitLSN = LogSequenceNumber.valueOf("6F/E3C53568"); + PGReplicationStream stream = conn + .getReplicationAPI() + .replicationStream() + .logical() + .withSlotName("replication_slot") + .withSlotOption("include-xids", false) + .withSlotOption("skip-empty-xacts", true) + .withStartPosition(waitLSN) + .start(); + while (true) { + ByteBuffer byteBuffer = stream.readPending(); + + if (byteBuffer == null) { + TimeUnit.MILLISECONDS.sleep(10L); + continue; + } + + int offset = byteBuffer.arrayOffset(); + byte[] source = byteBuffer.array(); + int length = source.length - offset; + System.out.println(new String(source, offset, length)); + + //如果需要flush lsn,根据业务实际情况调用以下接口 + //LogSequenceNumber lastRecv = stream.getLastReceiveLSN(); + //stream.setFlushedLSN(lastRecv); + //stream.forceUpdateStatus(); + + } + }else if(testMode == TEST_MODE_DROP_SLOT){ + conn.getReplicationAPI() + .dropReplicationSlot("replication_slot"); + } + } catch (Exception e) { + e.printStackTrace(); + return; + } + } +} + +``` + diff --git "a/content/zh/docs/Developerguide/\350\247\246\345\217\221\345\231\250\345\207\275\346\225\260.md" "b/content/zh/docs/Developerguide/\350\247\246\345\217\221\345\231\250\345\207\275\346\225\260.md" index 9c6b43b0c..296e032bf 100644 --- "a/content/zh/docs/Developerguide/\350\247\246\345\217\221\345\231\250\345\207\275\346\225\260.md" +++ "b/content/zh/docs/Developerguide/\350\247\246\345\217\221\345\231\250\345\207\275\346\225\260.md" @@ -11,10 +11,12 @@ 示例: ``` - postgres=# SELECT pg_get_triggerdef(oid) FROM pg_trigger; - pg_get_triggerdef - ---------------------------------------------------------------------------------------------------------------------- - (0 rows) + postgres=# select pg_get_triggerdef(oid) from pg_trigger; + pg_get_triggerdef + -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + CREATE TRIGGER tg1 BEFORE INSERT ON gtest26 FOR EACH STATEMENT EXECUTE PROCEDURE gtest_trigger_func() + CREATE TRIGGER tg03 AFTER INSERT ON gtest26 FOR EACH ROW WHEN ((new.a IS NOT NULL)) EXECUTE PROCEDURE gtest_trigger_func() + (2 rows) ``` - pg\_get\_triggerdef\(oid, boolean\) @@ -23,15 +25,27 @@ 参数:待查触发器的OID及是否以pretty方式展示。 + >![](public_sys-resources/icon-note.gif) **说明:** + >仅在创建trigger时指定WHEN条件的情况下,布尔类型参数才生效。 + 返回值类型:text 示例: ``` - postgres=# SELECT pg_get_triggerdef(oid, true) FROM pg_trigger; - pg_get_triggerdef - ---------------------------------------------------------------------------------------------------------------------- - (0 rows) + postgres=# select pg_get_triggerdef(oid,true) from pg_trigger; + pg_get_triggerdef + -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + CREATE TRIGGER tg1 BEFORE INSERT ON gtest26 FOR EACH STATEMENT EXECUTE PROCEDURE gtest_trigger_func() + CREATE TRIGGER tg03 AFTER INSERT ON gtest26 FOR EACH ROW WHEN (new.a IS NOT NULL) EXECUTE PROCEDURE gtest_trigger_func() + (2 rows) + + postgres=# select pg_get_triggerdef(oid,false) from pg_trigger; + pg_get_triggerdef + -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + CREATE TRIGGER tg1 BEFORE INSERT ON gtest26 FOR EACH STATEMENT EXECUTE PROCEDURE gtest_trigger_func() + CREATE TRIGGER tg03 AFTER INSERT ON gtest26 FOR EACH ROW WHEN ((new.a IS NOT NULL)) EXECUTE PROCEDURE gtest_trigger_func() + (2 rows) ``` diff --git "a/content/zh/docs/Developerguide/\351\207\215\350\256\276\345\217\202\346\225\260.md" "b/content/zh/docs/Developerguide/\351\207\215\350\256\276\345\217\202\346\225\260.md" index 39fa066c4..d935432d6 100644 --- "a/content/zh/docs/Developerguide/\351\207\215\350\256\276\345\217\202\346\225\260.md" +++ "b/content/zh/docs/Developerguide/\351\207\215\350\256\276\345\217\202\346\225\260.md" @@ -15,7 +15,7 @@ openGauss提供了多种修改GUC参数的方法,用户可以方便的针对 - 时间单位:ms(毫秒)、s(秒)、min(分钟)、h(小时)和d(天)。 -具体参数说明请参见[GUC参数说明](GUC参数说明.md)。 +具体参数说明请参见[GUC参数说明](zh-cn_topic_0242371481.md)。 ## GUC参数设置 @@ -43,21 +43,21 @@ openGauss提供了六类GUC参数,具体分类和设置方式请参考[表1](#

数据库服务端参数,在数据库启动时确定,可以通过配置文件指定。

-

支持表2中的方式一。

+

支持表2中的方式一、方式四。

SIGHUP

数据库全局参数,可在数据库启动时设置或者在数据库启动后,发送指令重新加载。

-

支持表2中的方式一、方式二。

+

支持表2中的方式一、方式二、方式四。

BACKEND

会话连接参数。在创建会话连接时指定,连接建立后无法修改。连接断掉后参数失效。内部使用参数,不推荐用户设置。

-

支持表2中的方式一、方式二。

+

支持表2中的方式一、方式二、方式四。

说明:

设置该参数后,下一次建立会话连接时生效。

@@ -118,15 +118,26 @@ openGauss提供了三种方式来修改GUC参数,具体操作请参考[表2](#

在下次会话中生效。

  • 设置用户级别的参数
    postgres=# ALTER USER username SET paraname TO value;

    在下次会话中生效。

    -
  • 设置会话级别的参数
    SET paraname TO value;
    +
  • 设置会话级别的参数
    postgres=# SET paraname TO value;

    修改本次会话中的取值。退出会话后,设置将失效。

  • +

    方式四

    + +

    使用ALTER SYSTEM SET修改数据库参数。

    + + + - ## 操作步骤 使用方式一设置数据库参数,以在数据库主节点设置archive\_mode参数为例。 @@ -150,10 +161,10 @@ openGauss提供了三种方式来修改GUC参数,具体操作请参考[表2](# gs_guc set -D /gaussdb/data/dbnode -c "archive_mode=off" ``` - >![](public_sys-resources/icon-note.gif) **说明:** - >可以使用以下命令在数据库节点上设置archive\_mode参数为off。 - >``` - >gs_guc set -N all -I all -c "archive_mode=off" + >![](public_sys-resources/icon-note.gif) **说明:** + >可以使用以下命令在数据库节点上设置archive\_mode参数为off。 + >``` + >gs_guc set -N all -I all -c "archive_mode=off" >``` 4. 重启数据库使参数生效。 @@ -213,10 +224,10 @@ openGauss提供了三种方式来修改GUC参数,具体操作请参考[表2](# Success to perform gs_guc! ``` - >![](public_sys-resources/icon-note.gif) **说明:** - >可以使用以下命令在数据库节点上设置authentication\_timeout参数为59s。 - >``` - >gs_guc reload -N all -I all -c "authentication_timeout = 59s" + >![](public_sys-resources/icon-note.gif) **说明:** + >可以使用以下命令在数据库节点上设置authentication\_timeout参数为59s。 + >``` + >gs_guc reload -N all -I all -c "authentication_timeout = 59s" >``` 4. 使用如下命令连接数据库。 @@ -286,7 +297,7 @@ openGauss提供了三种方式来修改GUC参数,具体操作请参考[表2](# - 设置数据库级别的参数 ``` - ALTER DATABASE postgres SET explain_perf_mode TO pretty; + postgres=# ALTER DATABASE postgres SET explain_perf_mode TO pretty; ``` 当结果显示为如下信息,则表示设置成功。 @@ -300,7 +311,7 @@ openGauss提供了三种方式来修改GUC参数,具体操作请参考[表2](# - 设置用户级别的参数 ``` - ALTER USER omm SET explain_perf_mode TO pretty; + postgres=# ALTER USER omm SET explain_perf_mode TO pretty; ``` 当结果显示为如下信息,则表示设置成功。 @@ -314,7 +325,7 @@ openGauss提供了三种方式来修改GUC参数,具体操作请参考[表2](# - 设置会话级别的参数 ``` - SET explain_perf_mode TO pretty; + postgres=# SET explain_perf_mode TO pretty; ``` 当结果显示为如下信息,则表示设置成功。 @@ -369,7 +380,7 @@ openGauss提供了三种方式来修改GUC参数,具体操作请参考[表2](# 4. 使用如下命令退出数据库。 ``` - \q + postgres=# \q ``` 5. 修改openGauss数据库主节点的最大连接数。 @@ -446,7 +457,7 @@ openGauss提供了三种方式来修改GUC参数,具体操作请参考[表2](# 4. 使用如下命令退出数据库。 ``` - \q + postgres=# \q ``` 5. 修改openGauss数据库主节点的客户端认证最长时间。 @@ -517,7 +528,7 @@ openGauss提供了三种方式来修改GUC参数,具体操作请参考[表2](# 4. 使用如下命令退出数据库。 ``` - \q + postgres=# \q ``` 5. 修改openGauss数据库节点的最大连接数。 @@ -595,7 +606,7 @@ openGauss提供了三种方式来修改GUC参数,具体操作请参考[表2](# 4. 使用如下命令退出数据库。 ``` - \q + postgres=# \q ``` 5. 修改openGauss数据库节点的客户端认证最长时间。 diff --git a/content/zh/menu/index.md b/content/zh/menu/index.md index e0e19870d..b8f024cd5 100644 --- a/content/zh/menu/index.md +++ b/content/zh/menu/index.md @@ -357,6 +357,7 @@ headless: true - [示例:重新执行应用SQL]({{< relref "./docs/Developerguide/示例-重新执行应用SQL.md" >}}) - [示例:通过本地文件导入导出数据]({{< relref "./docs/Developerguide/示例-通过本地文件导入导出数据.md" >}}) - [示例:从MY向openGauss进行数据迁移]({{< relref "./docs/Developerguide/示例-从MY向openGauss进行数据迁移.md" >}}) + - [示例:逻辑复制代码示例]({{< relref "./docs/Developerguide/示例-逻辑复制代码示例.md" >}}) - [JDBC接口参考]({{< relref "./docs/Developerguide/JDBC接口参考.md" >}}) - [基于ODBC开发]({{< relref "./docs/Developerguide/基于ODBC开发.md" >}}) - [ODBC包及依赖的库和头文件]({{< relref "./docs/Developerguide/ODBC包及依赖的库和头文件.md" >}}) @@ -526,8 +527,8 @@ headless: true - [使用指导]({{< relref "./docs/Developerguide/使用指导-12.md" >}}) - [获取帮助]({{< relref "./docs/Developerguide/获取帮助-13.md" >}}) - [命令参考]({{< relref "./docs/Developerguide/命令参考-14.md" >}}) - - [常见问题处理]({{< relref "./docs/Developerguide/常见问题处理-15.md" >}}) - + - [常见问题处理]({{< relref "./docs/Developerguide/常见问题处理-15.md" >}}) + - [内存表特性]({{< relref "./docs/Developerguide/内存表特性.md" >}}) - [概述]({{< relref "./docs/Developerguide/概述-16.md" >}}) - [内存表技术介绍]({{< relref "./docs/Developerguide/内存表技术介绍.md" >}}) @@ -539,8 +540,8 @@ headless: true - [X86服务器优化指导]({{< relref "./docs/Developerguide/X86服务器优化指导.md" >}}) - [ARM服务器优化指导]({{< relref "./docs/Developerguide/ARM服务器优化指导.md" >}}) - [MOT限制]({{< relref "./docs/Developerguide/MOT限制.md" >}}) - - [常见问题处理]({{< relref "./docs/Developerguide/常见问题处理-17.md" >}}) - + - [常见问题处理]({{< relref "./docs/Developerguide/常见问题处理-17.md" >}}) + - [性能调优]({{< relref "./docs/Developerguide/性能调优.md" >}}) - [总体调优思路]({{< relref "./docs/Developerguide/总体调优思路.md" >}}) - [确定性能调优范围]({{< relref "./docs/Developerguide/确定性能调优范围.md" >}}) @@ -587,7 +588,7 @@ headless: true - [行数的Hint]({{< relref "./docs/Developerguide/行数的Hint.md" >}}) - [Scan方式的Hint]({{< relref "./docs/Developerguide/Scan方式的Hint.md" >}}) - [子链接块名的hint]({{< relref "./docs/Developerguide/子链接块名的hint.md" >}}) - - [Hint的错误、冲突及告警]({{< relref "./docs/Developerguide/Hint的错误-冲突及告警.md" >}}) + - [Hint的错误、冲突及告警]({{< relref "./docs/Developerguide/Hint的错误-冲突及告警.md" >}}) - [TPCC性能调优测试指导]({{< relref "./docs/Developerguide/TPCC性能调优测试指导.md" >}}) - [概述]({{< relref "./docs/Developerguide/概述-20.md" >}}) - [搭建性能测试环境]({{< relref "./docs/Developerguide/搭建性能测试环境.md" >}}) @@ -604,7 +605,7 @@ headless: true - [中断调优]({{< relref "./docs/Developerguide/中断调优.md" >}}) - [网卡固件确认与更新]({{< relref "./docs/Developerguide/网卡固件确认与更新.md" >}}) - [数据库服务端及客户端绑核]({{< relref "./docs/Developerguide/数据库服务端及客户端绑核.md" >}}) - - [测试TPCC性能]({{< relref "./docs/Developerguide/测试TPCC性能.md" >}}) + - [测试TPCC性能]({{< relref "./docs/Developerguide/测试TPCC性能.md" >}}) - [配置运行参数]({{< relref "./docs/Developerguide/配置运行参数.md" >}}) - [查看参数当前取值]({{< relref "./docs/Developerguide/查看参数当前取值.md" >}}) - [重设参数]({{< relref "./docs/Developerguide/重设参数.md" >}}) @@ -734,6 +735,7 @@ headless: true - [ALTER SESSION]({{< relref "./docs/Developerguide/ALTER-SESSION.md" >}}) - [ALTER SYNONYM]({{< relref "./docs/Developerguide/ALTER-SYNONYM.md" >}}) - [ALTER SYSTEM KILL SESSION]({{< relref "./docs/Developerguide/ALTER-SYSTEM-KILL-SESSION.md" >}}) + - [ALTER SYSTEM SET]({{< relref "./docs/Developerguide/ALTER-SYSTEM-SET.md" >}}) - [ALTER TABLE]({{< relref "./docs/Developerguide/ALTER-TABLE.md" >}}) - [ALTER TABLE PARTITION]({{< relref "./docs/Developerguide/ALTER-TABLE-PARTITION.md" >}}) - [ALTER TABLESPACE]({{< relref "./docs/Developerguide/ALTER-TABLESPACE.md" >}}) -- Gitee