diff --git a/content/en/docs/Developerguide/asynchronous-i-o-operations.md b/content/en/docs/Developerguide/asynchronous-i-o-operations.md index 7438a2f771b1e1aff7e4cc2082808efff8fd4357..0935ebd0bd05986a25aceac1e2ed5e07f3ab1d65 100644 --- a/content/en/docs/Developerguide/asynchronous-i-o-operations.md +++ b/content/en/docs/Developerguide/asynchronous-i-o-operations.md @@ -17,7 +17,7 @@ This parameter is a SUSET parameter. Set it based on instructions provided in [ **Parameter description**: Specifies whether to enable the ADIO function. -This parameter is a POSTMASTER parameter. Set it based on instructions provided in [Table 1](resetting-parameters.md#en-us_topic_0237121562_en-us_topic_0059777490_t91a6f212010f4503b24d7943aed6d846). +The current version does not support enabling the asynchronous IO function. By default, this function is disabled. Please do not modify it yourself. **Value range**: Boolean diff --git a/content/en/docs/Developerguide/boolean-data-types.md b/content/en/docs/Developerguide/boolean-data-types.md index 402a3dfd8cc0932ecaff98bde3840997b2dc152f..b979045082bfda4026eae7205aefbdcb7ec23739 100644 --- a/content/en/docs/Developerguide/boolean-data-types.md +++ b/content/en/docs/Developerguide/boolean-data-types.md @@ -27,11 +27,11 @@ Valid literal values for the "true" state include: -TRUE, 't', 'true', 'y', 'yes', and '1' +TRUE, 't', 'true', 'y', 'yes', '1', 1, 'TRUE' Valid literal values for the "false" state include: -FALSE, 'f', 'false', 'n', 'no', and '0' +FALSE, 'f', 'false', 'n', 'no', '0', 'FALSE', false, 0 **TRUE** and **FALSE** are standard expressions, compatible with SQL statements. diff --git a/content/en/docs/Developerguide/mode-matching-operators.md b/content/en/docs/Developerguide/mode-matching-operators.md index 224921443a1d5496bfb0ad9aee8fc91422773d9e..8700cea9090626d00d240028eba76791da67c16f 100644 --- a/content/en/docs/Developerguide/mode-matching-operators.md +++ b/content/en/docs/Developerguide/mode-matching-operators.md @@ -2,56 +2,58 @@ There are three separate approaches to pattern matching provided by the database: the traditional SQL LIKE operator, the more recent SIMILAR TO operator, and POSIX-style regular expressions. Besides these basic operators, functions can be used to extract or replace matching substrings and to split a string at matching locations. -- LIKE - - Description: Determines whether the string matches the mode string following **LIKE**. The LIKE expression returns true if the string matches the supplied pattern. \(As expected, the NOT LIKE expression returns false if LIKE returns true, and vice versa.\) - - Matching rules: - - 1. This operator can succeed only when its pattern matches the entire string. If you want to match a sequence in any position within the string, the pattern must begin and end with a percent sign. - 2. The underscore \(\_\) represents \(matching\) any single character. Percentage \(%\) indicates the wildcard character of any string. - 3. To match a literal underscore or percent sign without matching other characters, the respective character in **pattern** must be preceded by the escape character. The default escape character is the backslash but a different one can be selected by using the **ESCAPE** clause. - 4. To match with escape characters, enter two escape characters. For example: To write a **pattern** constant containing a backslash \(\\\), you need to enter two backslashes in SQL statements. - - > **NOTE:** - >When **standard\_conforming\_strings** is set to **off**, any backslashes you write in literal string constants will need to be doubled. Therefore, writing a pattern matching a single backslash is actually going to write four backslashes in the statement. You can avoid this by selecting a different escape character by using ESCAPE, so that the backslash is no longer a special character of LIKE. But the backslash is still the special character of the character text analyzer, so you still need two backslashes.\) You can also select no escape character by writing **ESCAPE ''**. This effectively disables the escape mechanism, which makes it impossible to turn off the special meaning of underscore and percent signs in the pattern. - - 5. The keyword ILIKE can be used instead of LIKE to make the match case-insensitive. - 6. Operator \~\~ is equivalent to LIKE, and operator \~\~\* corresponds to ILIKE. - - For example: - - ``` - postgres=# SELECT 'abc' LIKE 'abc' AS RESULT; - result - ----------- - t - (1 row) - ``` - - ``` - postgres=# SELECT 'abc' LIKE 'a%' AS RESULT; - result - ----------- - t - (1 row) - ``` - - ``` - postgres=# SELECT 'abc' LIKE '_b_' AS RESULT; - result - ----------- - t - (1 row) - ``` - - ``` - postgres=# SELECT 'abc' LIKE 'c' AS RESULT; - result - ----------- - f - (1 row) - ``` +- LIKE + + Description: Determines whether the string matches the mode string following **LIKE**. The LIKE expression returns true if the string matches the supplied pattern. \(As expected, the NOT LIKE expression returns false if LIKE returns true, and vice versa.\) + + Matching rules: + + 1. This operator can succeed only when its pattern matches the entire string. If you want to match a sequence in any position within the string, the pattern must begin and end with a percent sign. + 2. The underscore \(\_\) represents \(matching\) any single character. Percentage \(%\) indicates the wildcard character of any string. + 3. To match a literal underscore or percent sign without matching other characters, the respective character in **pattern** must be preceded by the escape character. The default escape character is the backslash but a different one can be selected by using the **ESCAPE** clause. + 4. To match with escape characters, enter two escape characters. For example: To write a **pattern** constant containing a backslash \(\\\), you need to enter two backslashes in SQL statements. + + > **NOTE:** + >When **standard\_conforming\_strings** is set to **off**, any backslashes you write in literal string constants will need to be doubled. Therefore, writing a pattern matching a single backslash is actually going to write four backslashes in the statement. You can avoid this by selecting a different escape character by using ESCAPE, so that the backslash is no longer a special character of LIKE. But the backslash is still the special character of the character text analyzer, so you still need two backslashes.\) + > + >When compatible with MYSQL database mode (sql_compatibility = C), you can also select no escape character by writing **ESCAPE ''**. This effectively disables the escape mechanism, which makes it impossible to turn off the special meaning of underscore and percent signs in the pattern. + + 5. The keyword ILIKE can be used instead of LIKE to make the match case-insensitive. + 6. Operator \~\~ is equivalent to LIKE, and operator \~\~\* corresponds to ILIKE. + + For example: + + ``` + postgres=# SELECT 'abc' LIKE 'abc' AS RESULT; + result + ----------- + t + (1 row) + ``` + + ``` + postgres=# SELECT 'abc' LIKE 'a%' AS RESULT; + result + ----------- + t + (1 row) + ``` + + ``` + postgres=# SELECT 'abc' LIKE '_b_' AS RESULT; + result + ----------- + t + (1 row) + ``` + + ``` + postgres=# SELECT 'abc' LIKE 'c' AS RESULT; + result + ----------- + f + (1 row) + ``` - SIMILAR TO @@ -249,7 +251,7 @@ There are three separate approaches to pattern matching provided by the database For example: - + ``` postgres=# SELECT 'abc' ~ 'Abc' AS RESULT; result @@ -257,7 +259,7 @@ There are three separate approaches to pattern matching provided by the database f (1 row) ``` - + ``` postgres=# SELECT 'abc' ~* 'Abc' AS RESULT; result @@ -265,7 +267,7 @@ There are three separate approaches to pattern matching provided by the database t (1 row) ``` - + ``` postgres=# SELECT 'abc' !~ 'Abc' AS RESULT; result @@ -273,7 +275,7 @@ There are three separate approaches to pattern matching provided by the database t (1 row) ``` - + ``` postgres=# SELECT 'abc'!~* 'Abc' AS RESULT; result @@ -281,7 +283,7 @@ There are three separate approaches to pattern matching provided by the database f (1 row) ``` - + ``` postgres=# SELECT 'abc' ~ '^a' AS RESULT; result @@ -289,7 +291,7 @@ There are three separate approaches to pattern matching provided by the database t (1 row) ``` - + ``` postgres=# SELECT 'abc' ~ '(b|d)'AS RESULT; result @@ -297,7 +299,7 @@ There are three separate approaches to pattern matching provided by the database t (1 row) ``` - + ``` postgres=# SELECT 'abc' ~ '^(b|c)'AS RESULT; result @@ -305,7 +307,7 @@ There are three separate approaches to pattern matching provided by the database f (1 row) ``` - + Although most regular expression searches can be executed quickly, regular expressions can still be artificially made up of memory that takes a long time and any amount of memory. It is not recommended that you accept the regular expression search mode from the non-security mode source. If you must do this, you are advised to add the statement timeout limit. The search with the SIMILAR TO mode has the same security risks as the SIMILAR TO provides many capabilities that are the same as those of the POSIX- style regular expression. The LIKE search is much simpler than the other two options. Therefore, it is more secure to accept the non-secure mode source search. diff --git a/content/en/docs/Developerguide/record.md b/content/en/docs/Developerguide/record.md index 35d79dbba2668ecdff7b24b27641e4f3b9c3a36e..9c55c0e07a0c9cc4f492acec4b838360b8c10bff 100644 --- a/content/en/docs/Developerguide/record.md +++ b/content/en/docs/Developerguide/record.md @@ -33,7 +33,7 @@ The above syntax diagram is explained as follows: ## Example ``` -The table used in the following stored procedure is defined as follows: +The table used in the following example is defined as follows: postgres=# \d emp_rec Table "public.emp_rec" Column | Type | Modifiers @@ -47,7 +47,7 @@ postgres=# \d emp_rec comm | numeric(7,2) | deptno | numeric(2,0) | --- Perform array operations in the stored procedure. +-- Perform array operations in the function. postgres=# CREATE OR REPLACE FUNCTION regress_record(p_w VARCHAR2) RETURNS VARCHAR2 AS $$ @@ -105,10 +105,10 @@ END; $$ LANGUAGE plpgsql; --- Invoke the stored procedure. +-- Invoke the function. postgres=# CALL regress_record('abc'); --- Delete the stored procedure. -postgres=# DROP PROCEDURE regress_record; +-- Delete the function. +postgres=# DROP FUNCTION regress_record; ``` diff --git a/content/en/docs/Developerguide/trigger-functions.md b/content/en/docs/Developerguide/trigger-functions.md index 8cdd585482b9b686d1321854dcf414231695077f..e4fa378e2a75e2f078e4e27bc7831b0ad92877b9 100644 --- a/content/en/docs/Developerguide/trigger-functions.md +++ b/content/en/docs/Developerguide/trigger-functions.md @@ -1,21 +1,23 @@ # Trigger Functions -- pg\_get\_triggerdef\(oid\) +- pg\_get\_triggerdef\(oid\) - Description: Obtains the definition information of a trigger. + Description: Obtains the definition information of a trigger. - Parameter: OID of the trigger to be queried + Parameter: OID of the trigger to be queried - Return type: text + Return type: text - Example: + Example: - ``` - 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\) @@ -28,10 +30,19 @@ Example: ``` - 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/en/docs/Quickstart/miscellaneous-parameters.md b/content/en/docs/Quickstart/miscellaneous-parameters.md index b2654472c80ff9439c2a34fd231b078b7bbe2519..542932a9d7d40bd748527fda0024c5a706a345d1 100644 --- a/content/en/docs/Quickstart/miscellaneous-parameters.md +++ b/content/en/docs/Quickstart/miscellaneous-parameters.md @@ -288,7 +288,6 @@ add_months
postgres=# select length(lpad('123',0,'*')) from dual;
length
--------
-
(1 row)
postgres=# select length(lpad('123',0,'*')) from dual; @@ -313,6 +312,8 @@ length + + ## table\_skewness\_warning\_threshold **Parameter description**: Specifies the threshold for triggering a table skew alarm. diff --git a/content/en/docs/Toolreference/command-reference-1.md b/content/en/docs/Toolreference/command-reference-1.md index 55e03ef5d80bd708c4ffa921901a28a6276cacc2..51762d5548060d43a0dd890621a6e046aef5e94a 100644 --- a/content/en/docs/Toolreference/command-reference-1.md +++ b/content/en/docs/Toolreference/command-reference-1.md @@ -60,7 +60,7 @@- + The node naming convention is as follows:
- The node name must be lowercase letters (a-z), underscores (_), ASCII codes (\u200-\u377), special symbols #, numbers (0-9), or dollar signs $.
- The node name must start with a lowercase letter (a-z), underscore (_), and ASCII code (\u200-\u377).
- diff --git a/content/en/docs/Toolreference/gs_check.md b/content/en/docs/Toolreference/gs_check.md index a5033e48b9a192ac2b9e1efcf2164123c5d33fa1..45f16a4e3325a5292f8c705826e25c70a6a99995 100644 --- a/content/en/docs/Toolreference/gs_check.md +++ b/content/en/docs/Toolreference/gs_check.md @@ -6,9 +6,7 @@ ## Precautions -- Only user **root** is authorized to check new nodes added during cluster scale-out. In other cases, the check can be performed only by user **omm**. - Parameter **-i** or **-e** must be set. **-i** specifies a single item to be checked, and **-e** specifies an inspection scenario where multiple items will be checked. -- In non-local mode, user **root** can check only new nodes. - If **-i** is not set to a root item or no such items are contained in the check item list of the scenario specified by **-e**, you do not need to enter the name or password of a user with the root permissions. - You can run **--skip-root-items** to skip root items. - The blacklist check item applies only to the upgrade from R5 to R6. diff --git a/content/zh/docs/Developerguide/CREATE-TABLE-AS.md b/content/zh/docs/Developerguide/CREATE-TABLE-AS.md index 39b3b6162b93505d86293e9adc605d0d67d1f953..3bfa06e36cead4db0265d008593bd3a761041523 100644 --- a/content/zh/docs/Developerguide/CREATE-TABLE-AS.md +++ b/content/zh/docs/Developerguide/CREATE-TABLE-AS.md @@ -16,9 +16,10 @@ CREATE TABLE AS对源表进行一次查询,然后将数据写入新表中, ## 语法格式 ``` -CREATE [ UNLOGGED ] TABLE table_name +CREATE [ [ GLOBAL | LOCAL ] { TEMPORARY | TEMP } | UNLOGGED ] TABLE table_name [ (column_name [, ...] ) ] [ WITH ( {storage_parameter = value} [, ... ] ) ] + [ ON COMMIT { PRESERVE ROWS | DELETE ROWS | DROP } ] [ COMPRESS | NOCOMPRESS ] [ TABLESPACE tablespace_name ] AS query @@ -34,6 +35,25 @@ CREATE [ UNLOGGED ] TABLE table_name - 使用场景:非日志表不能保证数据的安全性,用户应该在确保数据已经做好备份的前提下使用,例如系统升级时进行数据的备份。 - 故障处理:当异常关机等操作导致非日志表上的索引发生数据丢失时,用户应该对发生错误的索引进行重建。 +- **GLOBAL | LOCAL** + + 创建临时表时可以在TEMP或TEMPORARY前指定GLOBAL或LOCAL关键字。如果指定GLOBAL关键字,openGauss会创建全局临时表,否则**openGauss**会创建本地临时表。 + +- **TEMPORARY | TEMP** + + 如果指定TEMP或TEMPORARY关键字,则创建的表为临时表。临时表分为全局临时表和本地临时表两种类型。创建临时表时如果指定GLOBAL关键字则为全局临时表,否则为本地临时表。 + + 全局临时表的元数据对所有会话可见,会话结束后元数据继续存在。会话与会话之间的用户数据、索引和统计信息相互隔离,每个会话只能看到和更改自己提交的数据。全局临时表有两种模式:一种是基于会话级别的(ON COMMIT PRESERVE ROWS), 当会话结束时自动清空用户数据;一种是基于事务级别的(ON COMMIT DELETE ROWS), 当执行commit或rollback时自动清空用户数据。建表时如果没有指定ON COMMIT选项,则缺省为会话级别。与本地临时表不同,全局临时表建表时可以指定非pg_temp_开头的schema。 + + 本地临时表只在当前会话可见,本会话结束后会自动删除。因此,在除当前会话连接的数据库节点故障时,仍然可以在当前会话上创建和使用临时表。由于临时表只在当前会话创建,对于涉及对临时表操作的DDL语句,会产生DDL失败的报错。因此,建议DDL语句中不要对临时表进行操作。TEMP和TEMPORARY等价。 + + > **须知:** + > + > - 本地临时表通过每个会话独立的以pg\_temp开头的schema来保证只对当前会话可见,因此,不建议用户在日常操作中手动删除以pg\_temp,pg\_toast\_temp开头的schema。 + > - 如果建表时不指定TEMPORARY/TEMP关键字,而指定表的schema为当前会话的pg\_temp\_开头的schema,则此表会被创建为临时表。 + > - ALTER/DROP全局临时表和索引,如果其它会话正在使用它,禁止操作。 + > - 全局临时表的DDL只会影响当前会话的用户数据和索引。例如truncate、reindex、analyze只对当前会话有效。 + - **table\_name** 要创建的表名。 @@ -80,6 +100,13 @@ CREATE [ UNLOGGED ] TABLE table_name 取值范围:10000\~60000 +- **ON COMMIT \{ PRESERVE ROWS | DELETE ROWS | DROP \}** + + ON COMMIT选项决定在事务中执行创建临时表操作,当事务提交时,此临时表的后续操作。有以下三个选项,当前支持PRESERVE ROWS和DELETE ROWS选项。 + + - PRESERVE ROWS(缺省值):提交时不对临时表做任何操作,临时表及其表数据保持不变。 + - DELETE ROWS:提交时删除临时表中数据。 + - DROP:提交时删除此临时表。(只支持本地临时表,不支持全局临时表) - **COMPRESS / NOCOMPRESS** diff --git a/content/zh/docs/Developerguide/SELECT-INTO.md b/content/zh/docs/Developerguide/SELECT-INTO.md index 5aa73250e410a734f82b87b7941573a72daa9ad9..c03c75643460ffb5720d63ac49bfd65cd6840173 100644 --- a/content/zh/docs/Developerguide/SELECT-INTO.md +++ b/content/zh/docs/Developerguide/SELECT-INTO.md @@ -16,7 +16,7 @@ CREATE TABLE AS的作用和SELECT INTO类似,且提供了SELECT INTO所提供 [ WITH [ RECURSIVE ] with_query [, ...] ] SELECT [ ALL | DISTINCT [ ON ( expression [, ...] ) ] ] { * | {expression [ [ AS ] output_name ]} [, ...] } - INTO [ UNLOGGED ] [ TABLE ] new_table + INTO [ [ GLOBAL | LOCAL ] { TEMPORARY | TEMP } | UNLOGGED ] [ TABLE ] new_table [ FROM from_item [, ...] ] [ WHERE condition ] [ GROUP BY expression [, ...] ] @@ -32,12 +32,38 @@ SELECT [ ALL | DISTINCT [ ON ( expression [, ...] ) ] ] ## 参数说明 -**INTO \[ UNLOGGED \] \[ TABLE \] new\_table** - -UNLOGGED指定表为非日志表。在非日志表中写入的数据不会被写入到预写日志中,这样就会比普通表快很多。但是,它也是不安全的,非日志表在冲突或异常关机后会被自动删截。非日志表中的内容也不会被复制到备用服务器中。在该类表中创建的索引也不会被自动记录。 +**INTO \[ \[ GLOBAL | LOCAL \] \{ TEMPORARY | TEMP \} | UNLOGGED \] \[ TABLE \] new\_table** new\_table指定新建表的名称。 +参数说明 + +- **UNLOGGED** + + 指定表为非日志表。在非日志表中写入的数据不会被写入到预写日志中,这样就会比普通表快很多。但是,它也是不安全的,非日志表在冲突或异常关机后会被自动删截。非日志表中的内容也不会被复制到备用服务器中。在该类表中创建的索引也不会被自动记录。 + + - 使用场景:非日志表不能保证数据的安全性,用户应该在确保数据已经做好备份的前提下使用,例如系统升级时进行数据的备份。 + - 故障处理:当异常关机等操作导致非日志表上的索引发生数据丢失时,用户应该对发生错误的索引进行重建。 + +- **GLOBAL | LOCAL** + + 创建临时表时可以在TEMP或TEMPORARY前指定GLOBAL或LOCAL关键字。如果指定GLOBAL关键字,openGauss会创建全局临时表,否则**openGauss**会创建本地临时表。 + +- **TEMPORARY | TEMP** + + 如果指定TEMP或TEMPORARY关键字,则创建的表为临时表。临时表分为全局临时表和本地临时表两种类型。创建临时表时如果指定GLOBAL关键字则为全局临时表,否则为本地临时表。 + + 全局临时表的元数据对所有会话可见,会话结束后元数据继续存在。会话与会话之间的用户数据、索引和统计信息相互隔离,每个会话只能看到和更改自己提交的数据。全局临时表有两种模式:一种是基于会话级别的(ON COMMIT PRESERVE ROWS), 当会话结束时自动清空用户数据;一种是基于事务级别的(ON COMMIT DELETE ROWS), 当执行commit或rollback时自动清空用户数据。建表时如果没有指定ON COMMIT选项,则缺省为会话级别。与本地临时表不同,全局临时表建表时可以指定非pg_temp_开头的schema。 + + 本地临时表只在当前会话可见,本会话结束后会自动删除。因此,在除当前会话连接的数据库节点故障时,仍然可以在当前会话上创建和使用临时表。由于临时表只在当前会话创建,对于涉及对临时表操作的DDL语句,会产生DDL失败的报错。因此,建议DDL语句中不要对临时表进行操作。TEMP和TEMPORARY等价。 + + > **须知:** + > + > - 本地临时表通过每个会话独立的以pg\_temp开头的schema来保证只对当前会话可见,因此,不建议用户在日常操作中手动删除以pg\_temp,pg\_toast\_temp开头的schema。 + > - 如果建表时不指定TEMPORARY/TEMP关键字,而指定表的schema为当前会话的pg\_temp\_开头的schema,则此表会被创建为临时表。 + > - ALTER/DROP全局临时表和索引,如果其它会话正在使用它,禁止操作。 + > - 全局临时表的DDL只会影响当前会话的用户数据和索引。例如truncate、reindex、analyze只对当前会话有效。 + > **说明:** >SELECT INTO的其它参数可参考SELECT的[参数说明](SELECT.md#zh-cn_topic_0237122184_zh-cn_topic_0059777449_sa812f65b8e8c4c638ec7840697222ddc)。 diff --git a/content/zh/docs/Developerguide/record.md b/content/zh/docs/Developerguide/record.md index d5d2934631b2536a03ae84af15d4fd1caf70ead4..00e928a659dcbe7fd4e7f0d1c72d66e9364c9d48 100644 --- a/content/zh/docs/Developerguide/record.md +++ b/content/zh/docs/Developerguide/record.md @@ -33,7 +33,7 @@ record类型的语法参见[图1](#zh-cn_topic_0237122215_fig092918316312)。 ## 示例 ``` -下面存储过程中用到的表定义如下: +下面示例中用到的表定义如下: postgres=# \d emp_rec Table "public.emp_rec" Column | Type | Modifiers @@ -47,7 +47,7 @@ postgres=# \d emp_rec comm | numeric(7,2) | deptno | numeric(2,0) | ---演示在存储过程中对数组进行操作。 +--演示在函数中对数组进行操作。 postgres=# CREATE OR REPLACE FUNCTION regress_record(p_w VARCHAR2) RETURNS VARCHAR2 AS $$ @@ -105,10 +105,10 @@ END; $$ LANGUAGE plpgsql; ---调用该存储过程。 +--调用该函数。 postgres=# CALL regress_record('abc'); ---删除存储过程。 -postgres=# DROP PROCEDURE regress_record; +--删除函数。 +postgres=# DROP FUNCTION regress_record; ``` diff --git "a/content/zh/docs/Developerguide/\345\205\266\345\256\203\351\200\211\351\241\271.md" "b/content/zh/docs/Developerguide/\345\205\266\345\256\203\351\200\211\351\241\271.md" index 0a7cd9773819cd29b9b6a140554af79365cfc444..74d7e126e0cbdd5ab3847e697490ce3b87de5eef 100644 --- "a/content/zh/docs/Developerguide/\345\205\266\345\256\203\351\200\211\351\241\271.md" +++ "b/content/zh/docs/Developerguide/\345\205\266\345\256\203\351\200\211\351\241\271.md" @@ -91,9 +91,11 @@ **参数说明:**报告当前数据库的服务端编码字符集。 +缺省情况下,gs_initdb会根据当前的系统环境初始化此参数,通过locale命令可以查看当前的配置环境。 + 该参数属于INTERNAL类型参数,为固定参数,用户无法修改此参数,只能查看。 -**默认值:**在创建数据库的时候决定的。 +**默认值:**在创建数据库的时候由当前系统环境决定的。 ## enable\_upgrade\_merge\_lock\_mode diff --git "a/content/zh/docs/Developerguide/\345\255\227\347\254\246\347\261\273\345\236\213.md" "b/content/zh/docs/Developerguide/\345\255\227\347\254\246\347\261\273\345\236\213.md" index 7d951d7a10aeb90f25308fe5ee2bc689489d73bb..512e6c6b72ff8f04eabf1f833665d9553770e666 100644 --- "a/content/zh/docs/Developerguide/\345\255\227\347\254\246\347\261\273\345\236\213.md" +++ "b/content/zh/docs/Developerguide/\345\255\227\347\254\246\347\261\273\345\236\213.md" @@ -44,26 +44,28 @@ openGauss支持的字符类型请参见[表1](#zh-cn_topic_0237121950_zh-cn_topi + - - + - + 最大为1GB-1,但还需要考虑到列描述头信息的大小, 以及列所在元组的大小限制(也小于1GB-1),因此TEXT类型最大大小可能小于1GB-1
+ + + + > **说明:** ->除了每列的大小限制以外,每个元组的总大小也不可超过1GB-8203字节(即1073733621字节)。 +>除了每列的大小限制以外,每个元组的总大小也不可超过1GB-1字节,主要受列的控制头信息、元组控制头信息等、以及元组中是否存在`NULL`字段等影响。 在openGauss里另外还有两种定长字符类型。在[表2](#zh-cn_topic_0237121950_zh-cn_topic_0059777889_tf74658686f5e4d979adf0ac04769ea16)里显示。name类型只用在内部系统表中,作为存储标识符,不建议普通用户使用。该类型长度当前定为64字节(63可用字符加结束符)。类型"char"只用了一个字节的存储空间。他在系统内部主要用于系统表,主要作为简单化的枚举类型使用。 diff --git "a/content/zh/docs/Developerguide/\346\250\241\345\274\217\345\214\271\351\205\215\346\223\215\344\275\234\347\254\246.md" "b/content/zh/docs/Developerguide/\346\250\241\345\274\217\345\214\271\351\205\215\346\223\215\344\275\234\347\254\246.md" index c734a6552e234c06aafc6f90fbd28367e88d2421..a593c71ea1d05f518add21313da21ad6d953876d 100644 --- "a/content/zh/docs/Developerguide/\346\250\241\345\274\217\345\214\271\351\205\215\346\223\215\344\275\234\347\254\246.md" +++ "b/content/zh/docs/Developerguide/\346\250\241\345\274\217\345\214\271\351\205\215\346\223\215\344\275\234\347\254\246.md" @@ -2,56 +2,58 @@ 数据库提供了三种独立的实现模式匹配的方法:SQL LIKE操作符、SIMILAR TO操作符和POSIX-风格的正则表达式。除了这些基本的操作符外,还有一些函数可用于提取或替换匹配子串并在匹配位置分离一个串。 -- LIKE - - 描述:判断字符串是否能匹配上LIKE后的模式字符串。如果字符串与提供的模式匹配,则LIKE表达式返回为真(NOT LIKE表达式返回假),否则返回为假(NOT LIKE表达式返回真)。 - - 匹配规则: - - 1. 此操作符只有在它的模式匹配整个串的时候才能成功。如果要匹配在串内任何位置的序列,该模式必须以百分号开头和结尾。 - 2. 下划线 (\_)代表(匹配)任何单个字符; 百分号(%)代表任意串的通配符。 - 3. 要匹配文本里的下划线或者百分号,在提供的模式里相应字符必须前导逃逸字符。逃逸字符的作用是禁用元字符的特殊含义,缺省的逃逸字符是反斜线,也可以用ESCAPE子句指定一个不同的逃逸字符。 - 4. 要匹配逃逸字符本身,写两个逃逸字符。例如要写一个包含反斜线的模式常量,那你就要在SQL语句里写两个反斜线。 - - > **说明:** - >参数standard\_conforming\_strings设置为off时,在文串常量中写的任何反斜线都需要被双写。因此,写一个匹配单个反斜线的模式实际上要在语句里写四个反斜线。(你可以通过用ESCAPE选择一个不同的逃逸字符来避免这种情况,这样反斜线就不再是LIKE的特殊字符了。但仍然是字符文本分析器的特殊字符,所以你还是需要两个反斜线。)我们也可以通过写ESCAPE ''的方式不选择逃逸字符,这样可以有效地禁用逃逸机制,但是没有办法关闭下划线和百分号在模式中的特殊含义。 - - 5. 关键字ILIKE可以用于替换LIKE,区别是LIKE大小写敏感,ILIKE大小写不敏感。 - 6. 操作符\~\~等效于LIKE,操作符\~\~\*等效于ILIKE。 - - 示例: - - ``` - postgres=# SELECT 'abc' LIKE 'abc' AS RESULT; - result - ----------- - t - (1 row) - ``` - - ``` - postgres=# SELECT 'abc' LIKE 'a%' AS RESULT; - result - ----------- - t - (1 row) - ``` - - ``` - postgres=# SELECT 'abc' LIKE '_b_' AS RESULT; - result - ----------- - t - (1 row) - ``` - - ``` - postgres=# SELECT 'abc' LIKE 'c' AS RESULT; - result - ----------- - f - (1 row) - ``` +- LIKE + + 描述:判断字符串是否能匹配上LIKE后的模式字符串。如果字符串与提供的模式匹配,则LIKE表达式返回为真(NOT LIKE表达式返回假),否则返回为假(NOT LIKE表达式返回真)。 + + 匹配规则: + + 1. 此操作符只有在它的模式匹配整个串的时候才能成功。如果要匹配在串内任何位置的序列,该模式必须以百分号开头和结尾。 + 2. 下划线 (\_)代表(匹配)任何单个字符; 百分号(%)代表任意串的通配符。 + 3. 要匹配文本里的下划线或者百分号,在提供的模式里相应字符必须前导逃逸字符。逃逸字符的作用是禁用元字符的特殊含义,缺省的逃逸字符是反斜线,也可以用ESCAPE子句指定一个不同的逃逸字符。 + 4. 要匹配逃逸字符本身,写两个逃逸字符。例如要写一个包含反斜线的模式常量,那你就要在SQL语句里写两个反斜线。 + + > **说明:** + >参数standard\_conforming\_strings设置为off时,在文串常量中写的任何反斜线都需要被双写。因此,写一个匹配单个反斜线的模式实际上要在语句里写四个反斜线。(你可以通过用ESCAPE选择一个不同的逃逸字符来避免这种情况,这样反斜线就不再是LIKE的特殊字符了。但仍然是字符文本分析器的特殊字符,所以你还是需要两个反斜线。) + > + >在兼容MYSQL数据库模式(即sql_compatibility = C)时,您也可以通过写ESCAPE ''的方式不选择逃逸字符,这样可以有效地禁用逃逸机制,但是没有办法关闭下划线和百分号在模式中的特殊含义。 + + 5. 关键字ILIKE可以用于替换LIKE,区别是LIKE大小写敏感,ILIKE大小写不敏感。 + 6. 操作符\~\~等效于LIKE,操作符\~\~\*等效于ILIKE。 + + 示例: + + ``` + postgres=# SELECT 'abc' LIKE 'abc' AS RESULT; + result + ----------- + t + (1 row) + ``` + + ``` + postgres=# SELECT 'abc' LIKE 'a%' AS RESULT; + result + ----------- + t + (1 row) + ``` + + ``` + postgres=# SELECT 'abc' LIKE '_b_' AS RESULT; + result + ----------- + t + (1 row) + ``` + + ``` + postgres=# SELECT 'abc' LIKE 'c' AS RESULT; + result + ----------- + f + (1 row) + ``` - SIMILAR TO @@ -249,7 +251,7 @@ 示例: - + ``` postgres=# SELECT 'abc' ~ 'Abc' AS RESULT; result @@ -257,7 +259,7 @@ f (1 row) ``` - + ``` postgres=# SELECT 'abc' ~* 'Abc' AS RESULT; result @@ -265,7 +267,7 @@ t (1 row) ``` - + ``` postgres=# SELECT 'abc' !~ 'Abc' AS RESULT; result @@ -273,7 +275,7 @@ t (1 row) ``` - + ``` postgres=# SELECT 'abc'!~* 'Abc' AS RESULT; result @@ -281,7 +283,7 @@ f (1 row) ``` - + ``` postgres=# SELECT 'abc' ~ '^a' AS RESULT; result @@ -289,7 +291,7 @@ t (1 row) ``` - + ``` postgres=# SELECT 'abc' ~ '(b|d)'AS RESULT; result @@ -297,7 +299,7 @@ t (1 row) ``` - + ``` postgres=# SELECT 'abc' ~ '^(b|c)'AS RESULT; result @@ -305,7 +307,7 @@ f (1 row) ``` - + 虽然大部分的正则表达式搜索都能很快地执行,但是正则表达式仍可能被人为地弄成需要任意长的时间和任意量的内存进行处理。不建议从非安全模式来源接受正则表达式搜索模式,如果必须这样做,建议加上语句超时限制。使用SIMILAR TO模式的搜索具有同样的安全性危险, 因为SIMILAR TO提供了很多和POSIX-风格正则表达式相同的能力。LIKE搜索比其他两种选项简单得多,因此在接受非安全模式来源搜索时要更安全些。 diff --git "a/content/zh/docs/Quickstart/\345\205\266\345\256\203\351\200\211\351\241\271.md" "b/content/zh/docs/Quickstart/\345\205\266\345\256\203\351\200\211\351\241\271.md" index 6ea1697fd5198b66d58a750f6f4c3ce428d4b355..d96a77ecb843f4cc1056e48aa05fa4ae4b19b3c2 100644 --- "a/content/zh/docs/Quickstart/\345\205\266\345\256\203\351\200\211\351\241\271.md" +++ "b/content/zh/docs/Quickstart/\345\205\266\345\256\203\351\200\211\351\241\271.md" @@ -288,7 +288,6 @@ add_months - + - + - postgres=# select length(lpad('123',0,'*')) from dual; length -------- - (1 row)
postgres=# select length(lpad('123',0,'*')) from dual; @@ -308,10 +307,8 @@ length- - - + + ## table\_skewness\_warning\_threshold diff --git a/content/zh/docs/Toolreference/gs_check.md b/content/zh/docs/Toolreference/gs_check.md index 21f1909e11c93dd73b9bb1aee8867875f024d1d1..1f0914db2c4de14a2d6bb59a78306363da3e8687 100644 --- a/content/zh/docs/Toolreference/gs_check.md +++ b/content/zh/docs/Toolreference/gs_check.md @@ -6,9 +6,7 @@ gs\_check改进增强,统一化当前系统中存在的各种检查工具, ## 注意事项 -- 扩容新节点检查只能在root用户下执行,其他场景都必须在omm用户下执行。 - 必须指定-i或-e参数,-i会检查指定的单项,-e会检查对应场景配置中的多项。 -- root用户在非本地模式下只能进行扩容新节点检查。 - 如果-i参数中不包含root类检查项或-e场景配置列表中没有root类检查项,则不需要交互输入root权限的用户及其密码。 - 可使用--skip-root-items跳过检查项中包含的root类检查,以免需要输入root权限用户及密码。 - 黑名单检查项仅适用于R5升级到R6。 diff --git a/content/zh/docs/Toolreference/gs_ctl.md b/content/zh/docs/Toolreference/gs_ctl.md index c6b9d7078f31102255159049a8fdac91f45597e4..c849f3ae28fcf084ca4600a244af066297ad48c0 100644 --- a/content/zh/docs/Toolreference/gs_ctl.md +++ b/content/zh/docs/Toolreference/gs_ctl.md @@ -74,13 +74,13 @@ gs\_ctl参数可分为如下几类: 控制在使用MERGE INTO ... WHEN MATCHED THEN UPDATE(参考MERGE INTO) 和INSERT ... ON DUPLICATE KEY UPDATE(参考INSERT)时,当目标表中一条目标数据与多条源数据冲突时UPDATE行为。
若设置此配置项,当存在上述场景时,该冲突行将会多次执行UPDATE;否则(默认)报错,即MERGE或INSERT操作失败。
-- 切换成功后,需要执行gs_om -t refreshconf 命令记录当前主备机信息。
+切换成功后,需要执行gs_om -t refreshconf 命令记录当前主备机信息,确保gs_om -t refreshconf 命令执行成功,否则再次重启会影响集群状态。
diff --git a/content/zh/docs/Toolreference/gs_om.md b/content/zh/docs/Toolreference/gs_om.md index 32d7ded6737bc82e7a0b12277b3bf4a3f3562b64..1c2db40027b5e37dd7fa521eafba99bd73843dda 100644 --- a/content/zh/docs/Toolreference/gs_om.md +++ b/content/zh/docs/Toolreference/gs_om.md @@ -2,7 +2,7 @@ ## 背景信息 -openGauss提供了gs\_om工具帮助对openGauss进行维护,包括启动openGauss、停止openGauss、查询openGauss状态、查询静态配置、查询openGauss状态、生成静态配置文件、生成动态配置文件、SSL证书替换、显示帮助信息和显示版本号信息等功能。 +openGauss提供了gs\_om工具帮助对openGauss进行维护,包括启动openGauss、停止openGauss、查询openGauss状态、查询静态配置、查询openGauss状态详细信息、生成静态配置文件、生成动态配置文件、SSL证书替换、显示帮助信息和显示版本号信息等功能。 ## 前提条件 @@ -46,7 +46,7 @@ openGauss提供了gs\_om工具帮助对openGauss进行维护,包括启动openG gs_om -t view [-o OUTPUT] ``` -- 查询openGauss状态 +- 查询openGauss状态详细信息 ``` gs_om -t query [-o OUTPUT] diff --git "a/content/zh/docs/installation/\344\270\200\344\270\273\344\270\200\345\244\207\351\205\215\347\275\256\346\226\207\344\273\266.md" "b/content/zh/docs/installation/\344\270\200\344\270\273\344\270\200\345\244\207\351\205\215\347\275\256\346\226\207\344\273\266.md" index 7cca3b048143b8d0c2d01aab27712358209410fb..49640a784dec238471e8e8b47fbfa98dea294cc4 100644 --- "a/content/zh/docs/installation/\344\270\200\344\270\273\344\270\200\345\244\207\351\205\215\347\275\256\346\226\207\344\273\266.md" +++ "b/content/zh/docs/installation/\344\270\200\344\270\273\344\270\200\345\244\207\351\205\215\347\275\256\346\226\207\344\273\266.md" @@ -28,8 +28,9 @@ - + + diff --git "a/content/zh/docs/installation/\344\270\200\351\224\256\345\274\217\347\216\257\345\242\203\346\270\205\347\220\206.md" "b/content/zh/docs/installation/\344\270\200\351\224\256\345\274\217\347\216\257\345\242\203\346\270\205\347\220\206.md" index b4296df35b4119500f3c96913e90100060e76c36..72c990ea013b035e803bb9c7a807feb6e65b0c2a 100644 --- "a/content/zh/docs/installation/\344\270\200\351\224\256\345\274\217\347\216\257\345\242\203\346\270\205\347\220\206.md" +++ "b/content/zh/docs/installation/\344\270\200\351\224\256\345\274\217\347\216\257\345\242\203\346\270\205\347\220\206.md" @@ -34,16 +34,16 @@ 4. 使用gs\_postuninstall进行清理。若为环境变量分离的模式安装的集群需要source环境变量分离文件ENVFILE。 ``` - ./gs_postuninstall -U omm -X /opt/software/openGauss/clusterconfig.xml --delete-user --delete-group + ./gs_postuninstall -U omm -X /opt/software/openGauss/cluster_config.xml --delete-user --delete-group ``` 或者在openGauss中每个节点执行本地后置清理。 ``` - ./gs_postuninstall -U omm -X /opt/software/openGauss/clusterconfig.xml --delete-user --delete-group -L + ./gs_postuninstall -U omm -X /opt/software/openGauss/cluster_config.xml --delete-user --delete-group -L ``` - omm为运行openGauss的操作系统用户名,/opt/software/openGauss/clusterconfig.xml为openGauss配置文件路径。 + omm为运行openGauss的操作系统用户名,/opt/software/openGauss/cluster\_config.xml为openGauss配置文件路径。 若为环境变量分离的模式安装的集群需删除之前source的环境变量分离的env参数 @@ -56,7 +56,7 @@ 清理主机的环境 ``` -gs_postuninstall -U omm -X /opt/software/openGauss/clusterconfig.xml --delete-user +gs_postuninstall -U omm -X /opt/software/openGauss/cluster_config.xml --delete-user Parsing the configuration file. Successfully parsed the configuration file. Check log file path. diff --git "a/content/zh/docs/installation/\344\272\206\350\247\243\345\256\211\350\243\205\346\265\201\347\250\213.md" "b/content/zh/docs/installation/\344\272\206\350\247\243\345\256\211\350\243\205\346\265\201\347\250\213.md" index 72c78f6b1c29f6edf035cdeef02e487e35a12177..223ebe59b78cc7100857f6d7f16bf836e215cc49 100644 --- "a/content/zh/docs/installation/\344\272\206\350\247\243\345\256\211\350\243\205\346\265\201\347\250\213.md" +++ "b/content/zh/docs/installation/\344\272\206\350\247\243\345\256\211\350\243\205\346\265\201\347\250\213.md" @@ -23,9 +23,9 @@ openGauss的安装流程如[图1](#fig18264185162412)所示。 在主备机正常时,出于维护的需要,将备机切换为主机,可保证切换过程中数据不丢失。
-切换成功后,需要执行gs_om -t refreshconf 命令记录当前主备机信息。
+切换成功后,需要执行gs_om -t refreshconf 命令记录当前主备机信息,确保gs_om -t refreshconf 命令执行成功,否则再次重启会影响集群状态。
switchover命令下发后,命令如果超时返回,后台进程的执行状态可能处于不可确定状态;如果备机在standby wait状态,可以通过重复下发switchover命令消除,使集群恢复到正常状态。
更多信息,请参考安装准备。
-+ - 安装包需要在官方网站上下载并且对安装包进行校验,详细请参见获取并校验安装包。
+安装包需要在openGauss开源社区下载并且对安装包内容进行检查,详细请参见。获取安装包
- diff --git "a/content/zh/docs/installation/\344\277\256\346\224\271\346\223\215\344\275\234\347\263\273\347\273\237\351\205\215\347\275\256.md" "b/content/zh/docs/installation/\344\277\256\346\224\271\346\223\215\344\275\234\347\263\273\347\273\237\351\205\215\347\275\256.md" index f1a91eb0ee89ed2a90cc1db9e97cb5411fd45266..46dd41c9ee029d45974d8e64343dda9b0b48431f 100644 --- "a/content/zh/docs/installation/\344\277\256\346\224\271\346\223\215\344\275\234\347\263\273\347\273\237\351\205\215\347\275\256.md" +++ "b/content/zh/docs/installation/\344\277\256\346\224\271\346\223\215\344\275\234\347\263\273\347\273\237\351\205\215\347\275\256.md" @@ -10,4 +10,6 @@ - **[设置网卡MTU值](设置网卡MTU值.md)** +- **[配置操作系统参数](配置操作系统参数.md)** +openGauss要求各主机上的操作系统参数设置成一定的值,以满足系统运行的性能要求等。 diff --git "a/content/zh/docs/installation/\345\205\263\351\227\255\346\223\215\344\275\234\347\263\273\347\273\237\351\230\262\347\201\253\345\242\231.md" "b/content/zh/docs/installation/\345\205\263\351\227\255\346\223\215\344\275\234\347\263\273\347\273\237\351\230\262\347\201\253\345\242\231.md" index 98c9d3409cdc1d2bbee936a471a144096217c5ce..946da007b1d4b8a446162280a3d8ed20fc5bea09 100644 --- "a/content/zh/docs/installation/\345\205\263\351\227\255\346\223\215\344\275\234\347\263\273\347\273\237\351\230\262\347\201\253\345\242\231.md" +++ "b/content/zh/docs/installation/\345\205\263\351\227\255\346\223\215\344\275\234\347\263\273\347\273\237\351\230\262\347\201\253\345\242\231.md" @@ -57,24 +57,7 @@ 目前仅支持在防火墙关闭的状态下进行安装。 -1. 检查防火墙是否关闭。 - - ``` - systemctl status firewalld - ``` - - 若防火墙未关闭,请执行[2](#zh-cn_topic_0241802566_zh-cn_topic_0085434636_zh-cn_topic_0059782018_li11887129193617); - - 若防火墙已关闭,则无需再关闭防火墙。 - -2. 关闭防火墙。 - - ``` - systemctl disable firewalld.service - systemctl stop firewalld.service - ``` - -3. 修改/etc/selinux/config文件中的“SELINUX“值为“disabled“。 +1. 修改/etc/selinux/config文件中的“SELINUX“值为“disabled“。 1. 使用VIM打开config文件。 ``` @@ -87,11 +70,28 @@ SELINUX=disabled ``` -4. 重新启动操作系统。 +2. 重新启动操作系统。 ``` reboot ``` -5. 在其他主机上重复步骤1到步骤3。 +3. 检查防火墙是否关闭。 + + ``` + systemctl status firewalld + ``` + + 若防火墙未关闭,请执行[4](#li17330102819394); + + 若防火墙已关闭,则无需再关闭防火墙。 + +4. 关闭防火墙。 + + ``` + systemctl disable firewalld.service + systemctl stop firewalld.service + ``` + +5. 在其他主机上重复步骤1到步骤4。 diff --git "a/content/zh/docs/installation/\345\207\206\345\244\207\345\256\211\350\243\205\347\224\250\346\210\267\345\217\212\347\216\257\345\242\203.md" "b/content/zh/docs/installation/\345\207\206\345\244\207\345\256\211\350\243\205\347\224\250\346\210\267\345\217\212\347\216\257\345\242\203.md" index 2197b8359e9ad882c8c9cf6879e1e8bf650fee19..2ae03866e1c129594f7dbe651fb1cd029ff09760 100644 --- "a/content/zh/docs/installation/\345\207\206\345\244\207\345\256\211\350\243\205\347\224\250\346\210\267\345\217\212\347\216\257\345\242\203.md" +++ "b/content/zh/docs/installation/\345\207\206\345\244\207\345\256\211\350\243\205\347\224\250\346\210\267\345\217\212\347\216\257\345\242\203.md" @@ -28,123 +28,61 @@ chmod 755 -R /opt/software ``` - > **说明:** - >- 不建议把安装包的存放目录规划到openGauss用户的家目录或其子目录下,可能导致权限问题。 - >- openGauss用户须具有/opt/software/openGauss目录的读写权限。 + > **说明:** + >- 不建议把安装包的存放目录规划到openGauss用户的家目录或其子目录下,可能导致权限问题。 + >- openGauss用户须具有/opt/software/openGauss目录的读写权限。 -2. 以release包为例,将安装包“openGauss\_x.x.x\_PACKAGES\_RELEASE.tar.gz”和配置文件“clusterconfig.xml”都上传至上一步所创建的目录中。 -3. 在安装包所在的目录下,解压安装包。 +2. 将安装包“openGauss-x.x.x-openEULER-64bit.tar.gz”和配置文件“cluster\_config.xml”都上传至上一步所创建的目录中。 +3. 在安装包所在的目录下,解压安装包openGauss-x.x.x-openEULER-64bit.tar.gz。安装包解压后,会在/opt/software/openGauss路径下自动生成script子目录,并且在script目录下生成gs\_preinstall等各种OM工具脚本。 ``` cd /opt/software/openGauss - tar -zxvf openGauss_x.x.x_PACKAGES_RELEASE.tar.gz - ``` - - 解压后的安装包说明见[表1](#zh-cn_topic_0241805803_zh-cn_topic_0085434653_zh-cn_topic_0059781995_te4a9d557337c400c85acff184476a722)。 - - **表 1** 安装包说明 - - - - -4. 对openGauss-x.x.x-openEULER-64bit.tar.gz进行解压。 - - ``` tar -zxvf openGauss-x.x.x-openEULER-64bit.tar.gz ``` - 安装包解压后,会在/opt/software/openGauss路径下自动生成script子目录,并且在script目录下生成gs\_preinstall等各种OM工具脚本。 - - > **说明:** - >- 在执行前置脚本gs\_preinstall时,需要规划好openGauss配置文件路径、安装包存放路径、程序安装目录、实例数据目录,后续普通用户使用过程中不能再更改这些路径。 - >- 运行前置脚本gs\_preinstall准备安装环境时,脚本内部会自动将openGauss配置文件、解压后的安装包同步拷贝到其余服务器的相同目录下。 - >- 在执行前置或者互信前,请检查/etc/profile文件中是否包含错误输出信息,如果存在错误输出,需手动处理。 + > **说明:** + >- 在执行前置脚本gs\_preinstall时,需要规划好openGauss配置文件路径、安装包存放路径、程序安装目录、实例数据目录,后续普通用户使用过程中不能再更改这些路径。 + >- 运行前置脚本gs\_preinstall准备安装环境时,脚本内部会自动将openGauss配置文件、解压后的安装包同步拷贝到其余服务器的相同目录下。 + >- 在执行前置或者互信前,请检查/etc/profile文件中是否包含错误输出信息,如果存在错误输出,需手动处理。 -5. 进入到工具脚本存放目录下。 +4. 进入到工具脚本存放目录下。 ``` cd /opt/software/openGauss/script ``` -6. 如果是openEuler的操作系统,执行如下命令打开performance.sh文件,用\#注释sysctl -w vm.min\_free\_kbytes=112640 &\> /dev/null,键入“ESC”键进入指令模式,执行**:wq**保存并退出修改。 +5. 如果是openEuler的操作系统,执行如下命令打开performance.sh文件,用\#注释sysctl -w vm.min\_free\_kbytes=112640 &\> /dev/null,键入“ESC”键进入指令模式,执行**:wq**保存并退出修改。 ``` vi /etc/profile.d/performance.sh ``` -7. 为确保openssl版本正确,执行预安装前请加载安装包中lib库。执行命令如下,其中_\{packagePath\}_为用户安装包放置的路径,本示例中为/opt/software/openGauss。 +6. 为确保openssl版本正确,执行预安装前请加载安装包中lib库。执行命令如下,其中_\{packagePath\}_为用户安装包放置的路径,本示例中为/opt/software/openGauss。 ``` export LD_LIBRARY_PATH={packagePath}/script/gspylib/clib:$LD_LIBRARY_PATH ``` -8. 为确保成功安装,检查 hostname 与 /etc/hostname 是否一致。预安装过程中,会对hostname进行检查。 -9. 使用gs\_preinstall准备好安装环境。若为共用环境需加入--sep-env-file=ENVFILE参数分离环境变量避免与其他用户相互影响,ENVFILE为用户自行指定的环境变量分离文件的路径。 +7. 为确保成功安装,检查 hostname 与 /etc/hostname 是否一致。预安装过程中,会对hostname进行检查。 +8. 使用gs\_preinstall准备好安装环境。若为共用环境需加入--sep-env-file=ENVFILE参数分离环境变量,避免与其他用户相互影响,ENVFILE为用户自行指定的环境变量分离文件的路径。 - 采用交互模式执行前置,并在执行过程中自动创建root用户互信和openGauss用户互信: ``` - ./gs_preinstall -U omm -G dbgrp -X /opt/software/openGauss/clusterconfig.xml + ./gs_preinstall -U omm -G dbgrp -X /opt/software/openGauss/cluster_config.xml ``` - omm为数据库管理员(也是运行openGauss的操作系统用户),dbgrp为运行openGauss的操作系统用户的群组名称,/opt/software/openGauss/clusterconfig.xml为openGauss配置文件路径。在执行过程中,用户根据提示选择是否创建互信,并输入root用户或openGauss用户的密码。 + omm为数据库管理员(也是运行openGauss的操作系统用户),dbgrp为运行openGauss的操作系统用户的群组名称,/opt/software/openGauss/cluster\_config.xml为openGauss配置文件路径。在执行过程中,用户根据提示选择是否创建互信,并输入root用户或openGauss用户的密码。 - 不允许创建root用户互信时,创建omm用户,在各主机上执行本地模式前置,然后用户手动创建openGauss用户互信:如果预安装指定-L参数,预安装前需手动将所有节点的主机名和ip映射关系,写入各个主机的/etc/hosts,并在每个映射关系后边加入注释内容:\#Gauss OM IP Hosts Mapping。 1. 执行下面命令准备安装环境。 ``` cd /opt/software/openGauss/script - ./gs_preinstall -U omm -G dbgrp -L -X /opt/software/openGauss/clusterconfig.xml + ./gs_preinstall -U omm -G dbgrp -L -X /opt/software/openGauss/cluster_config.xml ``` - > **说明:** - >此操作需要在每台主机上执行该命令。 + > **说明:** + >此操作需要在每台主机上执行该命令。 - 采用非交互模式执行前置: @@ -153,12 +91,12 @@ ``` cd /opt/software/openGauss/script - ./gs_preinstall -U omm -G dbgrp -X /opt/software/openGauss/clusterconfig.xml --non-interactive + ./gs_preinstall -U omm -G dbgrp -X /opt/software/openGauss/cluster_config.xml --non-interactive ``` - > **说明:** - >- 此模式要求用户确保在执行前,已经建立了各节点root用户互信和openGauss用户互信。 - >- root用户互信可能会存在安全隐患,因此建议用户在执行完安装后,立即删除各主机上root用户的互信。 + > **说明:** + >- 此模式要求用户确保在执行前,已经建立了各节点root用户互信和openGauss用户互信。 + >- root用户互信可能会存在安全隐患,因此建议用户在执行完安装后,立即删除各主机上root用户的互信。 @@ -168,7 +106,7 @@ 执行前置脚本: ``` -plat1:/opt/software/openGauss/script # ./gs_preinstall -U omm -G dbgrp -X /opt/software/openGauss/clusterconfig.xml +plat1:/opt/software/openGauss/script # ./gs_preinstall -U omm -G dbgrp -X /opt/software/openGauss/cluster_config.xml Parsing the configuration file. Successfully parsed the configuration file. Installing the tools on the local node. @@ -265,13 +203,12 @@ Fixing server package owner. Setting finish flag. Successfully set finish flag. Preinstallation succeeded. -S ``` root密码不一致也不能修改为一致,执行前置脚本本地安装模式: ``` -plat1:/opt/software/openGauss/script # ./gs_preinstall -U omm -G dbgrp -L -X /opt/software/openGauss/clusterconfig.xml +plat1:/opt/software/openGauss/script # ./gs_preinstall -U omm -G dbgrp -L -X /opt/software/openGauss/cluster_config.xml Parsing the configuration file. Successfully parsed the configuration file. Installing the tools on the local node. @@ -308,7 +245,7 @@ Preinstallation succeeded. 以非交互模式执行前置: ``` -plat1:/opt/software/openGauss/script # ./gs_preinstall -U omm -G dbgrp -X /opt/software/openGauss/clusterconfig.xml --non-interactive +plat1:/opt/software/openGauss/script # ./gs_preinstall -U omm -G dbgrp -X /opt/software/openGauss/cluster_config.xml --non-interactive Parsing the configuration file. Successfully parsed the configuration file. Installing the tools on the local node. @@ -356,6 +293,6 @@ Preinstallation succeeded. 如果准备安装环境失败请根据openGauss日志目录“$GAUSSLOG/om”下的“gs\_preinstall-YYYY-MM-DD\_HHMMSS.log”和“gs\_local-YYYY-MM-DD\_HHMMSS.log”中的日志信息排查错误。例如配置文件中“gaussdbLogPath”参数指定的路径为“/var/log/gaussdb”,则“$GAUSSLOG/om”路径为“/var/log/gaussdb/omm/om”,omm用户为运行openGauss的用户。 -> **须知:** ->准备安装用户及环境的过程中会使用root添加定时任务用于定时巡检和上报。 +> **须知:** +>准备安装用户及环境的过程中会使用root添加定时任务用于定时巡检和上报。 diff --git "a/content/zh/docs/installation/\345\210\233\345\273\272XML\351\205\215\347\275\256\346\226\207\344\273\266.md" "b/content/zh/docs/installation/\345\210\233\345\273\272XML\351\205\215\347\275\256\346\226\207\344\273\266.md" index 975e8500d684a438d79f6480c5422a6b771d1221..a94db3067221c0f04c71f2d9f229ca6db753887c 100644 --- "a/content/zh/docs/installation/\345\210\233\345\273\272XML\351\205\215\347\275\256\346\226\207\344\273\266.md" +++ "b/content/zh/docs/installation/\345\210\233\345\273\272XML\351\205\215\347\275\256\346\226\207\344\273\266.md" @@ -1,6 +1,6 @@ # 创建XML配置文件 -安装openGauss前需要创建XML文件。XML文件包含部署openGauss的服务器信息、安装路径、IP地址以及端口号等。用于告知openGauss如何部署。用户需根据不同场配置对应的XML文件。 +安装openGauss前需要创建cluster\_config.xml文件。cluster\_config.xml文件包含部署openGauss的服务器信息、安装路径、IP地址以及端口号等。用于告知openGauss如何部署。用户需根据不同场配置对应的XML文件。 下面以一主一备的方案为例,说明如何创建XML配置文件。 diff --git "a/content/zh/docs/installation/\345\210\235\345\247\213\345\214\226\345\256\211\350\243\205\347\216\257\345\242\203.md" "b/content/zh/docs/installation/\345\210\235\345\247\213\345\214\226\345\256\211\350\243\205\347\216\257\345\242\203.md" index 50efc705f6b9deaba7b6cc0c0a091a48c5072156..15b8e169ad148e77af3b018968de2b2d722aba67 100644 --- "a/content/zh/docs/installation/\345\210\235\345\247\213\345\214\226\345\256\211\350\243\205\347\216\257\345\242\203.md" +++ "b/content/zh/docs/installation/\345\210\235\345\247\213\345\214\226\345\256\211\350\243\205\347\216\257\345\242\203.md" @@ -6,6 +6,4 @@ 创建完openGauss配置文件后,在执行安装前,为了后续能以最小权限进行安装及openGauss管理操作,保证系统安全性,需要运行安装前置脚本gs\_preinstall准备好安装用户及环境。 - **[手工建立互信](手工建立互信.md)** openGauss在安装过程中,需要在openGauss中的主机间执行命令,传送文件等操作。因此,在普通用户安装前需要确保互信是连通的。前置脚本中会先建立root用户间的互信,然后创建普通用户,并建立普通用户间的互信。 -- **[配置操作系统参数](配置操作系统参数.md)** -openGauss要求各主机上的操作系统参数设置成一定的值,以满足系统运行的性能要求等。 diff --git "a/content/zh/docs/installation/\345\215\225\350\212\202\347\202\271\351\205\215\347\275\256\346\226\207\344\273\266.md" "b/content/zh/docs/installation/\345\215\225\350\212\202\347\202\271\351\205\215\347\275\256\346\226\207\344\273\266.md" index da4120369475a1092460308eb977302edfd20923..1f2ef0e7f8b727e9d82daa90d57bee680bf0d134 100644 --- "a/content/zh/docs/installation/\345\215\225\350\212\202\347\202\271\351\205\215\347\275\256\346\226\207\344\273\266.md" +++ "b/content/zh/docs/installation/\345\215\225\350\212\202\347\202\271\351\205\215\347\275\256\346\226\207\344\273\266.md" @@ -28,8 +28,9 @@ - + + diff --git "a/content/zh/docs/installation/\345\256\211\350\243\205openGauss.md" "b/content/zh/docs/installation/\345\256\211\350\243\205openGauss.md" index b44073284cc13597a4d2b482cebcb28d3da93632..c2e351e75728f530b95618e25fb416929c46dd11 100644 --- "a/content/zh/docs/installation/\345\256\211\350\243\205openGauss.md" +++ "b/content/zh/docs/installation/\345\256\211\350\243\205openGauss.md" @@ -1,7 +1,7 @@ # 安装openGauss - **[创建XML配置文件](创建XML配置文件.md)** -安装openGauss前需要创建XML文件。XML文件包含部署openGauss的服务器信息、安装路径、IP地址以及端口号等。用于告知openGauss如何部署。用户需根据不同场配置对应的XML文件。 +安装openGauss前需要创建cluster\_config.xml文件。cluster\_config.xml文件包含部署openGauss的服务器信息、安装路径、IP地址以及端口号等。用于告知openGauss如何部署。用户需根据不同场配置对应的XML文件。 - **[初始化安装环境](初始化安装环境.md)** 为了保证openGauss的正确安装,请首先对主机环境进行配置。 - **[执行安装](执行安装.md)** diff --git "a/content/zh/docs/installation/\345\256\211\350\243\205\345\207\206\345\244\207.md" "b/content/zh/docs/installation/\345\256\211\350\243\205\345\207\206\345\244\207.md" index b01451593aec1152d94cbaa8d0c2446a2133b0ce..889d96fa5b5ceafc5dcb9b0e6a4e4a472c502422 100644 --- "a/content/zh/docs/installation/\345\256\211\350\243\205\345\207\206\345\244\207.md" +++ "b/content/zh/docs/installation/\345\256\211\350\243\205\345\207\206\345\244\207.md" @@ -4,8 +4,8 @@ - **[了解安装流程](了解安装流程.md)** 本章节通过流程图简要介绍openGauss的安装流程。 -- **[获取并校验安装包](获取并校验安装包.md)** -为了防止安装包在传输过程中被恶意篡改或破坏给客户网络安全造成威胁,在获取到安装包后,需要对安装包的完整性进行校验,通过了校验的安装包才能部署。 +- **[获取安装包](获取安装包.md)** +openGauss开源社区上提供了安装包的获取方式。 - **[准备软硬件安装环境](准备软硬件安装环境.md)** 本章节描述安装前需要进行的环境准备。 - **[了解安装用户及用户组](了解安装用户及用户组.md)** diff --git "a/content/zh/docs/installation/\345\256\211\350\243\205\346\246\202\350\277\260.md" "b/content/zh/docs/installation/\345\256\211\350\243\205\346\246\202\350\277\260.md" index e719ec5b5d151bb04c83d41e70ff06f932d3ea20..99f9277908319d7b4fa6fb9c6e58f189587d1c8c 100644 --- "a/content/zh/docs/installation/\345\256\211\350\243\205\346\246\202\350\277\260.md" +++ "b/content/zh/docs/installation/\345\256\211\350\243\205\346\246\202\350\277\260.md" @@ -4,6 +4,6 @@ openGauss支持单机部署和单机HA部署两种部署方式。单机部署时 单机部署和单机HA部署均支持精简模式和兼容模式。精简模式下,您可以安装openGauss数据库并正常使用;兼容模式是在精简模式的基础上做了兼容增强,安装兼容包后会兼容主流数据库的接口名称,便于习惯主流数据库的用户使用openGauss。 -> **说明:** ->通过openGauss提供的脚本安装时,只允许在单台物理机只部署一个数据库系统。如果您需要在单台物理机部署多个数据库系统,建议您通过命令行安装,不需要通过openGauss提供安装脚本执行安装。 +> **说明:** +>通过openGauss提供的脚本安装时,只允许在单台物理机只部署一个数据库系统。如果您需要在单台物理机部署多个数据库系统,建议您通过命令行安装,不需要通过openGauss提供安装脚本执行安装。 diff --git "a/content/zh/docs/installation/\346\211\213\345\267\245\345\273\272\347\253\213\344\272\222\344\277\241.md" "b/content/zh/docs/installation/\346\211\213\345\267\245\345\273\272\347\253\213\344\272\222\344\277\241.md" index 8eea5df88dae08932e144450ff308889e8b7a7a8..ec0743be6529d00a676a9396490b7556c9753efe 100644 --- "a/content/zh/docs/installation/\346\211\213\345\267\245\345\273\272\347\253\213\344\272\222\344\277\241.md" +++ "b/content/zh/docs/installation/\346\211\213\345\267\245\345\273\272\347\253\213\344\272\222\344\277\241.md" @@ -2,8 +2,8 @@ openGauss在安装过程中,需要在openGauss中的主机间执行命令,传送文件等操作。因此,在普通用户安装前需要确保互信是连通的。前置脚本中会先建立root用户间的互信,然后创建普通用户,并建立普通用户间的互信。 -> **须知:** ->root用户互信可能会存在安全隐患,因此建议用户在使用完成后,立即删除各主机上root用户的互信。 +> **须知:** +>root用户互信可能会存在安全隐患,因此建议用户在使用完成后,立即删除各主机上root用户的互信。 ## 前提条件 @@ -42,7 +42,7 @@ openGauss在安装过程中,需要在openGauss中的主机间执行命令, 1. 创建一个执行互信脚本所需要的输入文本,并在此文件中添加openGauss中所有主机IP。 ``` - plat1:/opt/software/hostfile> vim hostfile + plat1:/opt/software/openGauss> vim hostfile 192.168.0.1 192.168.0.2 192.168.0.3 @@ -62,8 +62,8 @@ openGauss在安装过程中,需要在openGauss中的主机间执行命令, 如果openGauss各主机的root密码不一致,gs\_preinstall脚本无法建立互信,可以手工建立互信。 -> **说明:** ->建立互信的过程中需要生成如下4个文件:authorized\_keys、id\_rsa、id\_rsa.pub、known\_hosts。请勿删除或破坏这些互信相关的文件。 +> **说明:** +>建立互信的过程中需要生成如下4个文件:authorized\_keys、id\_rsa、id\_rsa.pub、known\_hosts。请勿删除或破坏这些互信相关的文件。 手工建立信任关系,步骤如下,plat1,plat2,plat3是主机名: @@ -104,7 +104,7 @@ openGauss在安装过程中,需要在openGauss中的主机间执行命令, 2. 生成本机授权文件。 ``` - cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys + cat .ssh/id_rsa.pub >> ~/.ssh/authorized_keys ``` 示例如下: @@ -153,9 +153,9 @@ openGauss在安装过程中,需要在openGauss中的主机间执行命令, # plat3 SSH-2.0-OpenSSH_5.1 ``` - > **说明:** - >- 当远程主机的公钥被接受以后,它就会被保存在文件$HOME/.ssh/known\_hosts之中。下次再连接这台主机,系统就会认出它的公钥已经保存在本地了,从而跳过警告部分。 - >- 如果该主机上known\_hosts文件被删除,互信仍然可以使用,但是会有告警提示信息。如果需要规避告警提示信息,请将/etc/ssh/ssh\_config配置文件中,StrictHostKeyChecking参数设置为no。 + > **说明:** + >- 当远程主机的公钥被接受以后,它就会被保存在文件$HOME/.ssh/known\_hosts之中。下次再连接这台主机,系统就会认出它的公钥已经保存在本地了,从而跳过警告部分。 + >- 如果该主机上known\_hosts文件被删除,互信仍然可以使用,但是会有告警提示信息。如果需要规避告警提示信息,请将/etc/ssh/ssh\_config配置文件中,StrictHostKeyChecking参数设置为no。 3. 将互信文件分发到其它所有主机上。在本例中,需要将plat1上的互信文件分发到plat2和plat3上。 @@ -205,8 +205,8 @@ openGauss在安装过程中,需要在openGauss中的主机间执行命令, plat1:~ # ``` - > **说明:** - >如果三个以上节点,和上述过程类似。假设节点名为plat1、plat2、plat3、......。第一步,需要在plat1上生成root用户的本机授权文件;第二步,需要收集所有待建互信主机\(plat1、plat2、plat3、......\)的公钥并写入到本机known\_hosts文件中;第三步,需要将互信文件分发到除本机外的所有其它主机\(plat2、plat3、......\)上;第四步,检查互信是否建立成功。 + > **说明:** + >如果三个以上节点,和上述过程类似。假设节点名为plat1、plat2、plat3、......。第一步,需要在plat1上生成root用户的本机授权文件;第二步,需要收集所有待建互信主机\(plat1、plat2、plat3、......\)的公钥并写入到本机known\_hosts文件中;第三步,需要将互信文件分发到除本机外的所有其它主机\(plat2、plat3、......\)上;第四步,检查互信是否建立成功。 ## 删除root用户互信 @@ -235,7 +235,7 @@ openGauss在安装过程中,需要在openGauss中的主机间执行命令, root用户建立互信示例: ``` -plat1:~ # gs_sshexkey -f /opt/software/hostfile -W Gauss_234 +plat1:~ # gs_sshexkey -f /opt/software/hostfile -W Gauss_123 Checking network information. All nodes in the network are Normal. Successfully checked network information. @@ -260,7 +260,7 @@ Successfully created SSH trust. 普通用户建立互信示例: ``` -gaussdb@plat1:~ > gs_sshexkey -f /opt/software/hostfile -W Gauss_234 +gaussdb@plat1:~ > gs_sshexkey -f /opt/software/hostfile -W Gauss_123 Checking network information. All nodes in the network are Normal. Successfully checked network information. diff --git "a/content/zh/docs/installation/\346\211\247\350\241\214\345\256\211\350\243\205.md" "b/content/zh/docs/installation/\346\211\247\350\241\214\345\256\211\350\243\205.md" index 6ae8ccf91e44350c953df10c5bdd20797a774e2f..680050f30b07d7d2429c22b5e16dbae755de0a1b 100644 --- "a/content/zh/docs/installation/\346\211\247\350\241\214\345\256\211\350\243\205.md" +++ "b/content/zh/docs/installation/\346\211\247\350\241\214\345\256\211\350\243\205.md" @@ -17,17 +17,17 @@ su - omm ``` - > **说明:** - >- omm指的是前置脚本gs\_preinstall中-U参数指定的用户。 - >- 安装脚本gs\_install必须以前置脚本中指定的omm执行,否则,脚本执行会报错。 + > **说明:** + >- omm指的是前置脚本gs\_preinstall中-U参数指定的用户。 + >- 安装脚本gs\_install必须以前置脚本中指定的omm执行,否则,脚本执行会报错。 3. 使用gs\_install安装openGauss。若为环境变量分离的模式安装的集群需要source环境变量分离文件ENVFILE。 ``` - gs_install -X /opt/software/openGauss/script/clusterconfig.xml + gs_install -X /opt/software/openGauss/cluster_config.xml ``` - /opt/software/openGauss/script/clusterconfig.xml为openGauss配置文件的路径。在执行过程中,用户需根据提示输入数据库的密码,密码具有一定的复杂度,为保证用户正常使用该数据库,请记住输入的数据库密码。 + /opt/software/openGauss/cluster\_config.xml为openGauss配置文件的路径。在执行过程中,用户需根据提示输入数据库的密码,密码具有一定的复杂度,为保证用户正常使用该数据库,请记住输入的数据库密码。 设置的密码要符合复杂度要求: @@ -39,8 +39,25 @@ 日志文件路径下会生成两个日志文件:“gs\_install-YYYY-MMDD\_HHMMSS.log”和“gs\_local-YYYY-MM-DD\_HHMMSS.log”。 - > **说明:** - >执行gs\_install脚本时,如果输入参数--autostart=no, 则工具脚本在配置(config)步骤完成后退出,不会自动启动openGauss,需要用户通过执行gs\_om -t start命令手动启动。 + > **说明:** + >- openGauss支持字符集的多种写法:gbk/GBK、UTF-8/UTF8/uft8/utf-8和Latine1/latine1。 + >- 安装时若不指定字符集,默认字符集为SQL\_ASCII,为简化和统一区域loacle默认设置为C,若想指定其他字符集和区域,请在安装时使用参数--gsinit-parameter="--locale=LOCALE"来指定,LOCALE为新数据库设置缺省的区域。 + > 例如用户要将数据库编码格式初始化为UTF-8,可以采用如下步骤: + > 用locale -a |grep utf8命令查看系统支持UTF-8编码的区域,如下: + > ``` + > omm@linux:~> locale -a|grep utf8 + > ``` + > 显示类似如下信息,其中en\_US.utf8表示区域en\_US支持UTF-8编码。 + > ``` + > ...... + > en_SG.utf8 + > en_US.utf8 + > ...... + > ``` + > 根据需要选择区域,如en\_US.utf8,初始化数据库时加入--locale=en\_US.utf8选项进行安装,示例如下: + > ``` + > gs_install -X /opt/software/openGauss/cluster_config.xml --gsinit-parameter="--locale=en_US.utf8" + > ``` 4. 安装执行成功之后,需要手动删除主机root用户的互信,即删除openGauss数据库各节点上的互信文件。 @@ -58,9 +75,9 @@
- - - -- -- - -- 用于Linux的客户端工具安装包。含gsql、dump restore tool、ODBC驱动、JDBC驱动、Libpq库。
-- - -- -- - -- -- - -- -- - -- -- - -- -- - -- -- - - -- -- ## 示例 执行安装: ``` -omm@plat1:~> gs_install -X /opt/software/openGauss/script/clusterconfig.xml +omm@plat1:~> gs_install -X /opt/software/openGauss/cluster_config.xml Parsing the configuration file. Check preinstall on every node. Successfully checked preinstall on every node. diff --git "a/content/zh/docs/installation/\350\216\267\345\217\226\345\256\211\350\243\205\345\214\205.md" "b/content/zh/docs/installation/\350\216\267\345\217\226\345\256\211\350\243\205\345\214\205.md" new file mode 100644 index 0000000000000000000000000000000000000000..6ed654f0785c48c42f0765fdb1aa0d0aa2ee141b --- /dev/null +++ "b/content/zh/docs/installation/\350\216\267\345\217\226\345\256\211\350\243\205\345\214\205.md" @@ -0,0 +1,69 @@ +# 获取安装包 + +openGauss开源社区上提供了安装包的获取方式。 + +## 操作步骤 + +1. 从openGauss开源社区下载对应平台的安装包。 + 1. 通过[https://opengauss.org/zh/download.html](https://opengauss.org/zh/download.html)登录openGauss开源社区。用户可根据安装包说明[表1](#zh-cn_topic_0241805803_zh-cn_topic_0085434653_zh-cn_topic_0059781995_te4a9d557337c400c85acff184476a722)按需下载。 + + **图1** 开源网站openGauss Server页面 + +  + + **图2** 开源网站openGauss Connectors页面 + +  + + **表 1** openGauss Connectors安装包说明 + + +
- + - + @@ -70,9 +87,9 @@ - + - + @@ -101,9 +118,9 @@ - + - + @@ -113,9 +130,9 @@ - - + - + @@ -143,13 +160,13 @@ + + - + - + - + @@ -159,16 +176,25 @@ + ++ ++ ++ + ++ + 2. 选择所需安装包单击“下载”。 + 3. 解压下载后的压缩包。 + +2. 检查安装包。 + + 解压安装包,检查安装目录及文件是否齐全。在安装包所在目录执行以下命令: + + ``` + tar -zxvf openGauss-x.x.x-openEuler-64bit.tar.gz + ls -1 + ``` + + 执行ls命令,显示类似如下信息: + + ``` + total 50M + drwxr-xr-x 14 root root 4.0K Jul 6 11:03 lib + -rw-r--r-- 1 root root 65 Jul 6 11:03 openGauss-x.x.x-openEuler-64bit.sha256 + -rw-r--r-- 1 root root 50M Jul 6 11:03 openGauss-x.x.x-openEuler-64bit.tar.bz2 + drwxr-xr-x 5 root root 4.0K Jul 6 11:03 script + -rw-r--r-- 1 root root 32 Jul 6 11:03 version.cfg + + ``` + + diff --git "a/content/zh/docs/installation/\350\256\276\347\275\256root\347\224\250\346\210\267\350\277\234\347\250\213\347\231\273\345\275\225.md" "b/content/zh/docs/installation/\350\256\276\347\275\256root\347\224\250\346\210\267\350\277\234\347\250\213\347\231\273\345\275\225.md" index 3558f80c280906aded2dc4d24fe41648853f6a93..c0c1e96de9f66a393cb79988da5c5e510db4d162 100644 --- "a/content/zh/docs/installation/\350\256\276\347\275\256root\347\224\250\346\210\267\350\277\234\347\250\213\347\231\273\345\275\225.md" +++ "b/content/zh/docs/installation/\350\256\276\347\275\256root\347\224\250\346\210\267\350\277\234\347\250\213\347\231\273\345\275\225.md" @@ -45,8 +45,8 @@ service sshd restart ``` - > **注意:** - >若执行命令后返回提示信息“Redirecting to /bin/systemctl restart sshd.service”,请执行命令:/bin/systemctl restart sshd.service。 + > **注意:** + >若执行命令后返回提示信息“Redirecting to /bin/systemctl restart sshd.service”,请执行命令:/bin/systemctl restart sshd.service。 4. 以root用户身份重新登录。 @@ -54,7 +54,7 @@ ssh xxx.xxx.xxx.xxx ``` - > **说明:** - >xxx.xxx.xxx.xxx为安装openGauss环境的ip。 + > **说明:** + >xxx.xxx.xxx.xxx为安装openGauss环境的ip。 diff --git "a/content/zh/docs/installation/\350\256\276\347\275\256\346\227\266\345\214\272\345\222\214\346\227\266\351\227\264.md" "b/content/zh/docs/installation/\350\256\276\347\275\256\346\227\266\345\214\272\345\222\214\346\227\266\351\227\264.md" index aee4af15c98377e7eb1ba650cdafb3de8ad4f2d6..f7b7505588ed684fd5e8f5e82bdc4297ecf351bc 100644 --- "a/content/zh/docs/installation/\350\256\276\347\275\256\346\227\266\345\214\272\345\222\214\346\227\266\351\227\264.md" +++ "b/content/zh/docs/installation/\350\256\276\347\275\256\346\227\266\345\214\272\345\222\214\346\227\266\351\227\264.md" @@ -6,8 +6,8 @@ cp /usr/share/zoneinfo/$地区/$时区 /etc/localtime ``` -> **说明:** ->_$地区/$时区为需要设置时区的信息,例如:Asia_/Shanghai。 +> **说明:** +>_$地区/$时区为需要设置时区的信息,例如:Asia_/Shanghai。 使用date -s命令将各主机的时间设置为统一时间,举例如下。 @@ -15,6 +15,6 @@ cp /usr/share/zoneinfo/$地区/$时区 /etc/localtime date -s Mon May 11 16:42:11 CST 2020 ``` -> **说明:** ->可以通过date命令查询主机时区。 +> **说明:** +>可以通过date命令查询主机时区。 diff --git "a/content/zh/docs/installation/\350\256\276\347\275\256\347\275\221\345\215\241MTU\345\200\274.md" "b/content/zh/docs/installation/\350\256\276\347\275\256\347\275\221\345\215\241MTU\345\200\274.md" index ae863617c41af2886e140e6daf3c06ff5092beee..b197dc9e3de0ec537ccb91423caca19238f829f7 100644 --- "a/content/zh/docs/installation/\350\256\276\347\275\256\347\275\221\345\215\241MTU\345\200\274.md" +++ "b/content/zh/docs/installation/\350\256\276\347\275\256\347\275\221\345\215\241MTU\345\200\274.md" @@ -1,6 +1,6 @@ # 设置网卡MTU值 -将各数据库节点的网卡MTU值设置为相同大小。MTU值推荐8192,要求不小于1500 +将各数据库节点的网卡MTU值设置为相同大小。对于X86,MTU值推荐1500;对于ARM,MTU值推荐8192。 ``` ifconfig 网卡编号 mtu 值 diff --git "a/content/zh/docs/installation/\350\275\257\347\241\254\344\273\266\347\216\257\345\242\203\350\246\201\346\261\202.md" "b/content/zh/docs/installation/\350\275\257\347\241\254\344\273\266\347\216\257\345\242\203\350\246\201\346\261\202.md" index 5418a506039e4aebd3b63dc82704b692e5fbfb8a..3795de1627bae6a0e79f1c0af7282dc59f03db31 100644 --- "a/content/zh/docs/installation/\350\275\257\347\241\254\344\273\266\347\216\257\345\242\203\350\246\201\346\261\202.md" +++ "b/content/zh/docs/installation/\350\275\257\347\241\254\344\273\266\347\216\257\345\242\203\350\246\201\346\261\202.md" @@ -15,9 +15,9 @@
+ + + ++ ++ + ++ ++ + ++ ++ + + ++ ++ -> **须知:** ->- 网卡参数配置功能只针对万兆及万兆以上级别的业务网卡。即backIp1所绑定的网卡。 ->- 设置网卡参数的命令只有在设置成功后,才会被写入系统启动文件。执行失败的信息会被记入后台日志中。 +> **须知:** +>- 网卡参数配置功能只针对万兆及万兆以上级别的业务网卡。即backIp1所绑定的网卡。 +>- 设置网卡参数的命令只有在设置成功后,才会被写入系统启动文件。执行失败的信息会被记入后台日志中。 diff --git "a/content/zh/docs/installation/\351\205\215\347\275\256\346\225\260\346\215\256\345\272\223\344\270\273\350\212\202\347\202\271\344\277\241\346\201\257.md" "b/content/zh/docs/installation/\351\205\215\347\275\256\346\225\260\346\215\256\345\272\223\344\270\273\350\212\202\347\202\271\344\277\241\346\201\257.md" index 86a0d79521649a8a93c8515355b24eb97dea9ca3..11ee8175c4aa35db028e516c7baea2485bceb81c 100644 --- "a/content/zh/docs/installation/\351\205\215\347\275\256\346\225\260\346\215\256\345\272\223\344\270\273\350\212\202\347\202\271\344\277\241\346\201\257.md" +++ "b/content/zh/docs/installation/\351\205\215\347\275\256\346\225\260\346\215\256\345\272\223\344\270\273\350\212\202\347\202\271\344\277\241\346\201\257.md" @@ -8,7 +8,7 @@ - + @@ -26,7 +26,7 @@ - - + @@ -52,30 +52,30 @@ **表 2** 软件环境要求 - 复杂的查询对内存的需求量比较高,在高并发场景下,可能出现内存不足。此时建议使用大内存的机器,或使用负载管理限制系统的并发。
+ - @@ -38,24 +38,12 @@ - - -- - -- -- - -- + - diff --git "a/content/zh/docs/installation/\351\205\215\347\275\256\346\225\260\346\215\256\345\272\223\345\220\215\347\247\260\345\217\212\345\220\204\351\241\271\347\233\256\345\275\225.md" "b/content/zh/docs/installation/\351\205\215\347\275\256\346\225\260\346\215\256\345\272\223\345\220\215\347\247\260\345\217\212\345\220\204\351\241\271\347\233\256\345\275\225.md" index 3679a9f7be53c8dab78f960911eba06df33276ca..d472e449640d238506f401d992d6c399822cb271 100644 --- "a/content/zh/docs/installation/\351\205\215\347\275\256\346\225\260\346\215\256\345\272\223\345\220\215\347\247\260\345\217\212\345\220\204\351\241\271\347\233\256\345\275\225.md" +++ "b/content/zh/docs/installation/\351\205\215\347\275\256\346\225\260\346\215\256\345\272\223\345\220\215\347\247\260\345\217\212\345\220\204\351\241\271\347\233\256\345\275\225.md" @@ -1,6 +1,6 @@ # 配置数据库名称及各项目录 -加粗字体内容为示例,可自行替换。每行信息均有注释进行说明。 +在script/gspylib/etc/conf/cluster\_config\_template.xml获取XML文件模板。加粗字体内容为示例,可自行替换。每行信息均有注释进行说明。 ``` @@ -28,13 +28,13 @@ ``` -> **须知:** ->- “/opt/huawei/install/om”存放互信等工具,避免权限问题,不要把实例数据目录放在此目录下。 ->- 安装目录和数据目录需为空或者不存在,否则可能导致安装失败。 ->- 在对数据库节点的实例进行具体配置时,需确保配置的目录之间不相互耦合。即各个配置目录不关联,删除其中任意一个目录,不会级联删除其它目录。如gaussdbAppPath为"/opt/huawei/install/app",gaussdbLogPath为"/opt/huawei/install/app/omm"。当gaussdbAppPath目录被删除时,会级联删除gaussdbLogPath目录,从而引起其它问题。 ->- 若需要安装脚本自动创建安装用户时各配置的目录需保证不与系统创建的默认用户目录耦合关联。 ->- 配置openGauss路径和实例路径时,路径中不能包含"|",";","&","$","<","\>","\`","\\\\","'","\\"","\{","\}","\(","\)","\[","\]","\~","\*","?"特殊字符。 ->- 配置数据库节点名称时,请通过hostname命令获取数据库节点的主机名称,替换示例中的node1,node2。 +> **须知:** +>- “/opt/huawei/install/om”存放互信等工具,避免权限问题,不要把实例数据目录放在此目录下。 +>- 安装目录和数据目录需为空或者不存在,否则可能导致安装失败。 +>- 在对数据库节点的实例进行具体配置时,需确保配置的目录之间不相互耦合。即各个配置目录不关联,删除其中任意一个目录,不会级联删除其它目录。如gaussdbAppPath为"/opt/huawei/install/app",gaussdbLogPath为"/opt/huawei/install/app/omm"。当gaussdbAppPath目录被删除时,会级联删除gaussdbLogPath目录,从而引起其它问题。 +>- 若需要安装脚本自动创建安装用户时各配置的目录需保证不与系统创建的默认用户目录耦合关联。 +>- 配置openGauss路径和实例路径时,路径中不能包含"|",";","&","$","<","\>","\`","\\\\","'","\\"","\{","\}","\(","\)","\[","\]","\~","\*","?"特殊字符。 +>- 配置数据库节点名称时,请通过hostname命令获取数据库节点的主机名称,替换示例中的node1,node2。 **表 1** 参数说明 diff --git "a/content/zh/docs/installation/\357\274\210\345\217\257\351\200\211\357\274\211\350\256\276\347\275\256\345\244\207\346\234\272\345\217\257\350\257\273.md" "b/content/zh/docs/installation/\357\274\210\345\217\257\351\200\211\357\274\211\350\256\276\347\275\256\345\244\207\346\234\272\345\217\257\350\257\273.md" index cd1c4483ff848c235a5a6e793ac32a700047bcd1..445845a305a0245a2a1af31fa0aa71fb1741782a 100644 --- "a/content/zh/docs/installation/\357\274\210\345\217\257\351\200\211\357\274\211\350\256\276\347\275\256\345\244\207\346\234\272\345\217\257\350\257\273.md" +++ "b/content/zh/docs/installation/\357\274\210\345\217\257\351\200\211\357\274\211\350\256\276\347\275\256\345\244\207\346\234\272\345\217\257\350\257\273.md" @@ -5,6 +5,6 @@ ## 操作步骤 1. 如果主备机上的openGauss数据库实例正在运行,请先分别停止主备机上的数据库实例。 -2. 根据[表2](配置数据库主节点信息.md#zh-cn_topic_0241802596_table15838192510429)对应路径,分别打开主机与备机的postgres.conf配置文件,找到并将对应参数修改为:wal\_level=hot\_standby ;hot\_standby = on;hot\_standby\_feedback = on。 +2. 根据[表2](配置数据库主节点信息.md#zh-cn_topic_0241802596_table15838192510429)对应路径,分别打开主机与备机的postgres.conf配置文件,找到并将对应参数修改为:wal\_level=hot\_standby;hot\_standby = on;hot\_standby\_feedback = on。 3. 修改完成后,分别启动主备机即可。 diff --git a/content/zh/menu/index.md b/content/zh/menu/index.md index d6b1c47069657393c14a370ded84cc3072cf9c87..39d20f06c9632fa8e81ebc0b96847f412c06da2b 100644 --- a/content/zh/menu/index.md +++ b/content/zh/menu/index.md @@ -234,41 +234,41 @@ headless: true - [用户在openGauss节点间的互信丢失]({{< relref "./docs/Quickstart/用户在openGauss节点间的互信丢失.md" >}}) - [安装指南]({{< relref "./docs/Installation/Installation.md" >}}) - - [安装概述]({{< relref "./docs/Installation/安装概述.md" >}}) - - [安装准备]({{< relref "./docs/Installation/安装准备.md" >}}) - - [了解安装流程]({{< relref "./docs/Installation/了解安装流程.md" >}}) - - [获取并校验安装包]({{< relref "./docs/Installation/获取并校验安装包.md" >}}) - - [准备软硬件安装环境]({{< relref "./docs/Installation/准备软硬件安装环境.md" >}}) - - [软硬件环境要求]({{< relref "./docs/Installation/软硬件环境要求.md" >}}) - - [修改操作系统配置]({{< relref "./docs/Installation/修改操作系统配置.md" >}}) - - [关闭操作系统防火墙]({{< relref "./docs/Installation/关闭操作系统防火墙.md" >}}) - - [设置字符集参数]({{< relref "./docs/Installation/设置字符集参数.md" >}}) - - [设置时区和时间]({{< relref "./docs/Installation/设置时区和时间.md" >}}) - - [关闭swap交换内存]({{< relref "./docs/Installation/关闭swap交换内存.md" >}}) - - [设置网卡MTU值]({{< relref "./docs/Installation/设置网卡MTU值.md" >}}) - - [设置root用户远程登录]({{< relref "./docs/Installation/设置root用户远程登录.md" >}}) - - [了解安装用户及用户组]({{< relref "./docs/Installation/了解安装用户及用户组.md" >}}) - - [安装openGauss]({{< relref "./docs/Installation/安装openGauss.md" >}}) - - [创建XML配置文件]({{< relref "./docs/Installation/创建XML配置文件.md" >}}) - - [配置数据库名称及各项目录]({{< relref "./docs/Installation/配置数据库名称及各项目录.md" >}}) - - [配置Host基本信息]({{< relref "./docs/Installation/配置Host基本信息.md" >}}) - - [配置数据库主节点信息]({{< relref "./docs/Installation/配置数据库主节点信息.md" >}}) - - [示例]({{< relref "./docs/Installation/示例.md" >}}) - - [单节点配置文件]({{< relref "./docs/Installation/单节点配置文件.md" >}}) - - [一主一备配置文件]({{< relref "./docs/Installation/一主一备配置文件.md" >}}) - - [初始化安装环境]({{< relref "./docs/Installation/初始化安装环境.md" >}}) - - [准备安装用户及环境]({{< relref "./docs/Installation/准备安装用户及环境.md" >}}) - - [手工建立互信]({{< relref "./docs/Installation/手工建立互信.md" >}}) - - [配置操作系统参数]({{< relref "./docs/Installation/配置操作系统参数.md" >}}) - - [执行安装]({{< relref "./docs/Installation/执行安装.md" >}}) - - [(可选)设置备机可读]({{< relref "./docs/Installation/(可选)设置备机可读.md" >}}) - - [安装验证]({{< relref "./docs/Installation/安装验证.md" >}}) - - [检查健康状态]({{< relref "./docs/Installation/检查健康状态.md" >}}) - - [初始配置]({{< relref "./docs/Installation/初始配置.md" >}}) - - [配置区域和字符集]({{< relref "./docs/Installation/配置区域和字符集.md" >}}) - - [卸载openGauss]({{< relref "./docs/Installation/卸载openGauss.md" >}}) - - [执行卸载]({{< relref "./docs/Installation/执行卸载.md" >}}) - - [一键式环境清理]({{< relref "./docs/Installation/一键式环境清理.md" >}}) + - [安装概述]({{< relref "./docs/Installation/安装概述.md" >}}) + - [安装准备]({{< relref "./docs/Installation/安装准备.md" >}}) + - [了解安装流程]({{< relref "./docs/Installation/了解安装流程.md" >}}) + - [获取安装包]({{< relref "./docs/Installation/获取安装包.md" >}}) + - [准备软硬件安装环境]({{< relref "./docs/Installation/准备软硬件安装环境.md" >}}) + - [软硬件环境要求]({{< relref "./docs/Installation/软硬件环境要求.md" >}}) + - [修改操作系统配置]({{< relref "./docs/Installation/修改操作系统配置.md" >}}) + - [关闭操作系统防火墙]({{< relref "./docs/Installation/关闭操作系统防火墙.md" >}}) + - [设置字符集参数]({{< relref "./docs/Installation/设置字符集参数.md" >}}) + - [设置时区和时间]({{< relref "./docs/Installation/设置时区和时间.md" >}}) + - [关闭swap交换内存]({{< relref "./docs/Installation/关闭swap交换内存.md" >}}) + - [设置网卡MTU值]({{< relref "./docs/Installation/设置网卡MTU值.md" >}}) + - [配置操作系统参数]({{< relref "./docs/Installation/配置操作系统参数.md" >}}) + - [设置root用户远程登录]({{< relref "./docs/Installation/设置root用户远程登录.md" >}}) + - [了解安装用户及用户组]({{< relref "./docs/Installation/了解安装用户及用户组.md" >}}) + - [安装openGauss]({{< relref "./docs/Installation/安装openGauss.md" >}}) + - [创建XML配置文件]({{< relref "./docs/Installation/创建XML配置文件.md" >}}) + - [配置数据库名称及各项目录]({{< relref "./docs/Installation/配置数据库名称及各项目录.md" >}}) + - [配置Host基本信息]({{< relref "./docs/Installation/配置Host基本信息.md" >}}) + - [配置数据库主节点信息]({{< relref "./docs/Installation/配置数据库主节点信息.md" >}}) + - [示例]({{< relref "./docs/Installation/示例.md" >}}) + - [单节点配置文件]({{< relref "./docs/Installation/单节点配置文件.md" >}}) + - [一主一备配置文件]({{< relref "./docs/Installation/一主一备配置文件.md" >}}) + - [初始化安装环境]({{< relref "./docs/Installation/初始化安装环境.md" >}}) + - [准备安装用户及环境]({{< relref "./docs/Installation/准备安装用户及环境.md" >}}) + - [手工建立互信]({{< relref "./docs/Installation/手工建立互信.md" >}}) + - [执行安装]({{< relref "./docs/Installation/执行安装.md" >}}) + - [(可选)设置备机可读]({{< relref "./docs/Installation/(可选)设置备机可读.md" >}}) + - [安装验证]({{< relref "./docs/Installation/安装验证.md" >}}) + - [检查健康状态]({{< relref "./docs/Installation/检查健康状态.md" >}}) + - [卸载openGauss]({{< relref "./docs/Installation/卸载openGauss.md" >}}) + - [执行卸载]({{< relref "./docs/Installation/执行卸载.md" >}}) + - [一键式环境清理]({{< relref "./docs/Installation/一键式环境清理.md" >}}) + - [初始配置]({{< relref "./docs/Installation/初始配置.md" >}}) + - [配置区域和字符集]({{< relref "./docs/Installation/配置区域和字符集.md" >}}) - [管理员指南]({{< relref "./docs/Administratorguide/Administratorguide.md" >}}) - [启停openGauss]({{< relref "./docs/Administratorguide/启停openGauss.md" >}}) @@ -87,4 +75,3 @@