This is an automated email from the ASF dual-hosted git repository.
dataroaring pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris-website.git
The following commit(s) were added to refs/heads/master by this push:
new 112cea11c04 [Feature](backup) backup privileges catalogs and
workloadgroups (#3382)
112cea11c04 is described below
commit 112cea11c046634cf7c46454f67cee4ea90e6d0f
Author: Yongqiang YANG <[email protected]>
AuthorDate: Tue Feb 10 14:15:43 2026 -0800
[Feature](backup) backup privileges catalogs and workloadgroups (#3382)
## Summary
- Recreate the backup/restore global-scope documentation updates from
#1442.
- Add `GLOBAL` syntax updates and related examples for
BACKUP/RESTORE/CANCEL/SHOW RESTORE statements.
- Document `backup_*` and `reserve_*` properties for global backup and
restore.
## Versions
- [x] dev
- [x] 4.x
- [ ] 3.x
- [ ] 2.1
- [ ] 2.0
## Languages
- [x] Chinese
- [x] English
## Reference
- Original PR: https://github.com/apache/doris-website/pull/1442
---------
Co-authored-by: zhangyuan <[email protected]>
---
.../data-modification/backup-and-restore/BACKUP.md | 22 +++++++++++++--
.../backup-and-restore/CANCEL-BACKUP.md | 8 +++++-
.../backup-and-restore/CANCEL-RESTORE.md | 7 ++++-
.../backup-and-restore/RESTORE.md | 31 +++++++++++++++++++++-
.../backup-and-restore/SHOW-RESTORE.md | 7 ++++-
.../data-modification/backup-and-restore/BACKUP.md | 21 +++++++++++++--
.../backup-and-restore/CANCEL-BACKUP.md | 7 ++++-
.../backup-and-restore/CANCEL-RESTORE.md | 7 ++++-
.../backup-and-restore/RESTORE.md | 30 ++++++++++++++++++++-
.../backup-and-restore/SHOW-RESTORE.md | 8 +++++-
.../data-modification/backup-and-restore/BACKUP.md | 21 +++++++++++++--
.../backup-and-restore/CANCEL-BACKUP.md | 7 ++++-
.../backup-and-restore/CANCEL-RESTORE.md | 7 ++++-
.../backup-and-restore/RESTORE.md | 30 ++++++++++++++++++++-
.../backup-and-restore/SHOW-RESTORE.md | 8 +++++-
.../data-modification/backup-and-restore/BACKUP.md | 22 +++++++++++++--
.../backup-and-restore/CANCEL-BACKUP.md | 8 +++++-
.../backup-and-restore/CANCEL-RESTORE.md | 7 ++++-
.../backup-and-restore/RESTORE.md | 31 +++++++++++++++++++++-
.../backup-and-restore/SHOW-RESTORE.md | 7 ++++-
20 files changed, 272 insertions(+), 24 deletions(-)
diff --git
a/docs/sql-manual/sql-statements/data-modification/backup-and-restore/BACKUP.md
b/docs/sql-manual/sql-statements/data-modification/backup-and-restore/BACKUP.md
index 986ddaf92ba..f86f2919fb1 100644
---
a/docs/sql-manual/sql-statements/data-modification/backup-and-restore/BACKUP.md
+++
b/docs/sql-manual/sql-statements/data-modification/backup-and-restore/BACKUP.md
@@ -8,12 +8,12 @@
## Description
-This statement is used to back up the data under the specified database. This
command is an asynchronous operation. After the submission is successful, you
need to check the progress through the [SHOW BACKUP](./SHOW-BACKUP.md) command.
+This statement is used to back up the data under the specified database. This
command is an asynchronous operation. After submission, you can check progress
with the `SHOW BACKUP` command.
## Syntax
```sql
-BACKUP SNAPSHOT [<db_name>.]<snapshot_name>
+BACKUP [GLOBAL] SNAPSHOT [<db_name>.]<snapshot_name>
TO `<repository_name>`
[ { ON | EXCLUDE } ]
( <table_name> [ PARTITION ( <partition_name> [, ...] ) ]
@@ -55,6 +55,9 @@ Data snapshot attributes, in the format: `<key>` =
`<value>`,currently support
- "type" = "full": indicates that this is a full update (default)
- "timeout" = "3600": The task timeout period, the default is one day. in
seconds.
+- "backup_privilege" = "true": Whether to back up privileges. Use with `BACKUP
GLOBAL`.
+- "backup_catalog" = "true": Whether to back up catalogs. Use with `BACKUP
GLOBAL`.
+- "backup_workload_group" = "true": Whether to back up workload groups. Use
with `BACKUP GLOBAL`.
## Access Control Requirements
@@ -107,3 +110,18 @@ EXCLUDE (example_tbl);
BACKUP SNAPSHOT example_db.snapshot_label3
TO example_repo;
```
+
+5. Back up privileges, catalogs, and workload groups to repository
example_repo:
+
+```sql
+BACKUP GLOBAL SNAPSHOT snapshot_label5
+TO example_repo;
+```
+
+6. Back up privileges and catalogs to repository example_repo:
+
+```sql
+BACKUP GLOBAL SNAPSHOT snapshot_label6
+TO example_repo
+PROPERTIES ("backup_privilege" = "true", "backup_catalog" = "true");
+```
diff --git
a/docs/sql-manual/sql-statements/data-modification/backup-and-restore/CANCEL-BACKUP.md
b/docs/sql-manual/sql-statements/data-modification/backup-and-restore/CANCEL-BACKUP.md
index 3a8a7fb6373..24f4ab4bbe7 100644
---
a/docs/sql-manual/sql-statements/data-modification/backup-and-restore/CANCEL-BACKUP.md
+++
b/docs/sql-manual/sql-statements/data-modification/backup-and-restore/CANCEL-BACKUP.md
@@ -13,7 +13,7 @@ This statement is used to cancel an ongoing BACKUP task.
## Syntax
```sql
-CANCEL BACKUP FROM <db_name>;
+CANCEL [GLOBAL] BACKUP [FROM <db_name>];
```
## Parameters
@@ -29,3 +29,9 @@ The name of the database to which the backup task belongs.
```sql
CANCEL BACKUP FROM example_db;
```
+
+2. Cancel the GLOBAL BACKUP task.
+
+```sql
+CANCEL GLOBAL BACKUP;
+```
diff --git
a/docs/sql-manual/sql-statements/data-modification/backup-and-restore/CANCEL-RESTORE.md
b/docs/sql-manual/sql-statements/data-modification/backup-and-restore/CANCEL-RESTORE.md
index 9988ac3e201..d6868d9cea6 100644
---
a/docs/sql-manual/sql-statements/data-modification/backup-and-restore/CANCEL-RESTORE.md
+++
b/docs/sql-manual/sql-statements/data-modification/backup-and-restore/CANCEL-RESTORE.md
@@ -13,7 +13,7 @@ This statement is used to cancel an ongoing RESTORE task.
## Syntax
```sql
-CANCEL RESTORE FROM <db_name>;
+CANCEL [GLOBAL] RESTORE [FROM <db_name>];
```
## Parameters
@@ -34,3 +34,8 @@ The name of the database to which the recovery task belongs.
CANCEL RESTORE FROM example_db;
```
+2. Cancel the GLOBAL RESTORE task.
+
+```sql
+CANCEL GLOBAL RESTORE;
+```
diff --git
a/docs/sql-manual/sql-statements/data-modification/backup-and-restore/RESTORE.md
b/docs/sql-manual/sql-statements/data-modification/backup-and-restore/RESTORE.md
index 81081a8497d..1be51285169 100644
---
a/docs/sql-manual/sql-statements/data-modification/backup-and-restore/RESTORE.md
+++
b/docs/sql-manual/sql-statements/data-modification/backup-and-restore/RESTORE.md
@@ -13,7 +13,7 @@ This statement is used to restore the data backed up by the
BACKUP command to th
## Syntax
```sql
-RESTORE SNAPSHOT [<db_name>.]<snapshot_name>
+RESTORE [GLOBAL] SNAPSHOT [<db_name>.]<snapshot_name>
FROM `<repository_name>`
[ { ON | EXCLUDE } ] (
`<table_name>` [PARTITION (`<partition_name>`, ...)] [AS `<table_alias>`]
@@ -53,6 +53,9 @@ Restoration operation attributes, the format is `<key>` =
`<value>`,currently
- "atomic_restore" - : The data will be loaded into a temporary table first,
and then the original table will be replaced atomically to ensure that the read
and write of the target table are not affected during the recovery process.
- "force_replace" : Force replace when the table exists and the schema is
different with the backup table.
- Note that to enable `force_replace`, you must enable `atomic_restore`
+- "reserve_privilege" = "true": Whether to restore privileges. Use with
`RESTORE GLOBAL`.
+- "reserve_catalog" = "true": Whether to restore catalogs. Use with `RESTORE
GLOBAL`.
+- "reserve_workload_group" = "true": Whether to restore workload groups. Use
with `RESTORE GLOBAL`.
## Optional Parameters
@@ -129,3 +132,29 @@ PROPERTIES
"backup_timestamp"="2018-05-04-18-12-18"
);
```
+
+4. Restore privileges, catalogs, and workload groups from backup snapshot_4 in
example_repo, with time version "2018-05-04-18-12-18".
+
+```sql
+RESTORE GLOBAL SNAPSHOT `snapshot_4`
+FROM `example_repo`
+EXCLUDE ( `backup_tbl` )
+PROPERTIES
+(
+ "backup_timestamp"="2018-05-04-18-12-18"
+);
+```
+
+5. Restore privileges and workload groups from backup snapshot_5 in
example_repo, with time version "2018-05-04-18-12-18".
+
+```sql
+RESTORE GLOBAL SNAPSHOT `snapshot_5`
+FROM `example_repo`
+EXCLUDE ( `backup_tbl` )
+PROPERTIES
+(
+ "backup_timestamp"="2018-05-04-18-12-18",
+ "reserve_privilege" = "true",
+ "reserve_workload_group" = "true"
+);
+```
diff --git
a/docs/sql-manual/sql-statements/data-modification/backup-and-restore/SHOW-RESTORE.md
b/docs/sql-manual/sql-statements/data-modification/backup-and-restore/SHOW-RESTORE.md
index 29e9878c3a6..9612a36a356 100644
---
a/docs/sql-manual/sql-statements/data-modification/backup-and-restore/SHOW-RESTORE.md
+++
b/docs/sql-manual/sql-statements/data-modification/backup-and-restore/SHOW-RESTORE.md
@@ -13,7 +13,7 @@ This statement is used to view RESTORE tasks
## Syntax
```SQL
-SHOW [BRIEF] RESTORE [FROM <db_name>]
+SHOW [BRIEF] [GLOBAL] RESTORE [FROM <db_name>]
```
## Parameters
@@ -57,3 +57,8 @@ The name of the database to which the recovery task belongs.
SHOW RESTORE FROM example_db;
```
+2. View the latest GLOBAL RESTORE task.
+
+```sql
+SHOW GLOBAL RESTORE;
+```
diff --git
a/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-statements/data-modification/backup-and-restore/BACKUP.md
b/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-statements/data-modification/backup-and-restore/BACKUP.md
index 91ac001ec68..c74636fac36 100644
---
a/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-statements/data-modification/backup-and-restore/BACKUP.md
+++
b/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-statements/data-modification/backup-and-restore/BACKUP.md
@@ -8,12 +8,12 @@
## 描述
-该语句用于备份指定数据库下的数据。该命令为异步操作,提交成功后,需通过 [SHOW BACKUP](./SHOW-BACKUP.md) 命令查看进度。
+该语句用于备份指定数据库下的数据。该命令为异步操作,提交成功后,需通过 `SHOW BACKUP` 命令查看进度。
## 语法
```sql
-BACKUP SNAPSHOT [<db_name>.]<snapshot_name>
+BACKUP [GLOBAL] SNAPSHOT [<db_name>.]<snapshot_name>
TO `<repository_name>`
[ { ON | EXCLUDE } ]
( <table_name> [ PARTITION ( <partition_name> [, ...] ) ]
@@ -55,6 +55,9 @@ TO `<repository_name>`
- "type" = "full":表示这是一次全量更新(默认)
- "timeout" = "3600":任务超时时间,默认为一天。单位秒。
+- "backup_privilege" = "true":是否备份权限信息,与 `BACKUP GLOBAL` 一起使用。
+- "backup_catalog" = "true":是否备份 catalog 信息,与 `BACKUP GLOBAL` 一起使用。
+- "backup_workload_group" = "true":是否备份 workload group 信息,与 `BACKUP GLOBAL`
一起使用。
## 权限控制
@@ -108,3 +111,17 @@ BACKUP SNAPSHOT example_db.snapshot_label3
TO example_repo;
```
+5. 备份权限、catalog 和 workload group 信息到仓库 example_repo 中:
+
+```sql
+BACKUP GLOBAL SNAPSHOT snapshot_label5
+TO example_repo;
+```
+
+6. 备份权限和 catalog 信息到仓库 example_repo 中:
+
+```sql
+BACKUP GLOBAL SNAPSHOT snapshot_label6
+TO example_repo
+PROPERTIES ("backup_privilege" = "true", "backup_catalog" = "true");
+```
diff --git
a/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-statements/data-modification/backup-and-restore/CANCEL-BACKUP.md
b/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-statements/data-modification/backup-and-restore/CANCEL-BACKUP.md
index 2558e5838f4..3cac5870d2e 100644
---
a/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-statements/data-modification/backup-and-restore/CANCEL-BACKUP.md
+++
b/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-statements/data-modification/backup-and-restore/CANCEL-BACKUP.md
@@ -13,7 +13,7 @@
## 语法
```sql
-CANCEL BACKUP FROM <db_name>;
+CANCEL [GLOBAL] BACKUP [FROM <db_name>];
```
## 参数
@@ -30,3 +30,8 @@ CANCEL BACKUP FROM <db_name>;
CANCEL BACKUP FROM example_db;
```
+2. 取消 GLOBAL BACKUP 任务。
+
+```sql
+CANCEL GLOBAL BACKUP;
+```
diff --git
a/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-statements/data-modification/backup-and-restore/CANCEL-RESTORE.md
b/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-statements/data-modification/backup-and-restore/CANCEL-RESTORE.md
index c76511947bb..80214342acf 100644
---
a/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-statements/data-modification/backup-and-restore/CANCEL-RESTORE.md
+++
b/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-statements/data-modification/backup-and-restore/CANCEL-RESTORE.md
@@ -13,7 +13,7 @@
## 语法
```sql
-CANCEL RESTORE FROM <db_name>;
+CANCEL [GLOBAL] RESTORE [FROM <db_name>];
```
## 参数
@@ -34,3 +34,8 @@ CANCEL RESTORE FROM <db_name>;
CANCEL RESTORE FROM example_db;
```
+2. 取消 GLOBAL RESTORE 任务。
+
+```sql
+CANCEL GLOBAL RESTORE;
+```
diff --git
a/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-statements/data-modification/backup-and-restore/RESTORE.md
b/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-statements/data-modification/backup-and-restore/RESTORE.md
index 2bc5496f9b9..a2f04722e6f 100644
---
a/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-statements/data-modification/backup-and-restore/RESTORE.md
+++
b/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-statements/data-modification/backup-and-restore/RESTORE.md
@@ -13,7 +13,7 @@
## 语法
```sql
-RESTORE SNAPSHOT [<db_name>.]<snapshot_name>
+RESTORE [GLOBAL] SNAPSHOT [<db_name>.]<snapshot_name>
FROM `<repository_name>`
[ { ON | EXCLUDE } ] (
`<table_name>` [PARTITION (`<partition_name>`, ...)] [AS `<table_alias>`]
@@ -51,6 +51,9 @@ FROM `<repository_name>`
- "atomic_restore":先将数据加载到临时表中,再以原子方式替换原表,确保恢复过程中不影响目标表的读写。
- "force_replace":当表存在且架构与备份表不同时,强制替换。
- 注意,要启用 "force_replace",必须启用 "atomic_restore"
+- "reserve_privilege" = "true":是否恢复权限信息,与 `RESTORE GLOBAL` 一起使用。
+- "reserve_catalog" = "true":是否恢复 catalog 信息,与 `RESTORE GLOBAL` 一起使用。
+- "reserve_workload_group" = "true":是否恢复 workload group 信息,与 `RESTORE GLOBAL`
一起使用。
## 可选参数
@@ -128,3 +131,28 @@ PROPERTIES
);
```
+4. 从 example_repo 中恢复备份 snapshot_4 的权限、catalog 和 workload group 信息,时间版本为
"2018-05-04-18-12-18"。
+
+```sql
+RESTORE GLOBAL SNAPSHOT `snapshot_4`
+FROM `example_repo`
+EXCLUDE ( `backup_tbl` )
+PROPERTIES
+(
+ "backup_timestamp"="2018-05-04-18-12-18"
+);
+```
+
+5. 从 example_repo 中恢复备份 snapshot_5 的权限和 workload group 信息,时间版本为
"2018-05-04-18-12-18"。
+
+```sql
+RESTORE GLOBAL SNAPSHOT `snapshot_5`
+FROM `example_repo`
+EXCLUDE ( `backup_tbl` )
+PROPERTIES
+(
+ "backup_timestamp"="2018-05-04-18-12-18",
+ "reserve_privilege" = "true",
+ "reserve_workload_group" = "true"
+);
+```
diff --git
a/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-statements/data-modification/backup-and-restore/SHOW-RESTORE.md
b/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-statements/data-modification/backup-and-restore/SHOW-RESTORE.md
index 35920651f15..d15d4bfdd47 100644
---
a/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-statements/data-modification/backup-and-restore/SHOW-RESTORE.md
+++
b/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-statements/data-modification/backup-and-restore/SHOW-RESTORE.md
@@ -13,7 +13,7 @@
## 语法
```SQL
-SHOW [BRIEF] RESTORE [FROM <db_name>]
+SHOW [BRIEF] [GLOBAL] RESTORE [FROM <db_name>]
```
## 参数
@@ -56,3 +56,9 @@ SHOW [BRIEF] RESTORE [FROM <db_name>]
```sql
SHOW RESTORE FROM example_db;
```
+
+2. 查看最近一次 GLOBAL RESTORE 任务。
+
+```sql
+SHOW GLOBAL RESTORE;
+```
diff --git
a/i18n/zh-CN/docusaurus-plugin-content-docs/version-4.x/sql-manual/sql-statements/data-modification/backup-and-restore/BACKUP.md
b/i18n/zh-CN/docusaurus-plugin-content-docs/version-4.x/sql-manual/sql-statements/data-modification/backup-and-restore/BACKUP.md
index 91ac001ec68..c74636fac36 100644
---
a/i18n/zh-CN/docusaurus-plugin-content-docs/version-4.x/sql-manual/sql-statements/data-modification/backup-and-restore/BACKUP.md
+++
b/i18n/zh-CN/docusaurus-plugin-content-docs/version-4.x/sql-manual/sql-statements/data-modification/backup-and-restore/BACKUP.md
@@ -8,12 +8,12 @@
## 描述
-该语句用于备份指定数据库下的数据。该命令为异步操作,提交成功后,需通过 [SHOW BACKUP](./SHOW-BACKUP.md) 命令查看进度。
+该语句用于备份指定数据库下的数据。该命令为异步操作,提交成功后,需通过 `SHOW BACKUP` 命令查看进度。
## 语法
```sql
-BACKUP SNAPSHOT [<db_name>.]<snapshot_name>
+BACKUP [GLOBAL] SNAPSHOT [<db_name>.]<snapshot_name>
TO `<repository_name>`
[ { ON | EXCLUDE } ]
( <table_name> [ PARTITION ( <partition_name> [, ...] ) ]
@@ -55,6 +55,9 @@ TO `<repository_name>`
- "type" = "full":表示这是一次全量更新(默认)
- "timeout" = "3600":任务超时时间,默认为一天。单位秒。
+- "backup_privilege" = "true":是否备份权限信息,与 `BACKUP GLOBAL` 一起使用。
+- "backup_catalog" = "true":是否备份 catalog 信息,与 `BACKUP GLOBAL` 一起使用。
+- "backup_workload_group" = "true":是否备份 workload group 信息,与 `BACKUP GLOBAL`
一起使用。
## 权限控制
@@ -108,3 +111,17 @@ BACKUP SNAPSHOT example_db.snapshot_label3
TO example_repo;
```
+5. 备份权限、catalog 和 workload group 信息到仓库 example_repo 中:
+
+```sql
+BACKUP GLOBAL SNAPSHOT snapshot_label5
+TO example_repo;
+```
+
+6. 备份权限和 catalog 信息到仓库 example_repo 中:
+
+```sql
+BACKUP GLOBAL SNAPSHOT snapshot_label6
+TO example_repo
+PROPERTIES ("backup_privilege" = "true", "backup_catalog" = "true");
+```
diff --git
a/i18n/zh-CN/docusaurus-plugin-content-docs/version-4.x/sql-manual/sql-statements/data-modification/backup-and-restore/CANCEL-BACKUP.md
b/i18n/zh-CN/docusaurus-plugin-content-docs/version-4.x/sql-manual/sql-statements/data-modification/backup-and-restore/CANCEL-BACKUP.md
index 2558e5838f4..3cac5870d2e 100644
---
a/i18n/zh-CN/docusaurus-plugin-content-docs/version-4.x/sql-manual/sql-statements/data-modification/backup-and-restore/CANCEL-BACKUP.md
+++
b/i18n/zh-CN/docusaurus-plugin-content-docs/version-4.x/sql-manual/sql-statements/data-modification/backup-and-restore/CANCEL-BACKUP.md
@@ -13,7 +13,7 @@
## 语法
```sql
-CANCEL BACKUP FROM <db_name>;
+CANCEL [GLOBAL] BACKUP [FROM <db_name>];
```
## 参数
@@ -30,3 +30,8 @@ CANCEL BACKUP FROM <db_name>;
CANCEL BACKUP FROM example_db;
```
+2. 取消 GLOBAL BACKUP 任务。
+
+```sql
+CANCEL GLOBAL BACKUP;
+```
diff --git
a/i18n/zh-CN/docusaurus-plugin-content-docs/version-4.x/sql-manual/sql-statements/data-modification/backup-and-restore/CANCEL-RESTORE.md
b/i18n/zh-CN/docusaurus-plugin-content-docs/version-4.x/sql-manual/sql-statements/data-modification/backup-and-restore/CANCEL-RESTORE.md
index c76511947bb..80214342acf 100644
---
a/i18n/zh-CN/docusaurus-plugin-content-docs/version-4.x/sql-manual/sql-statements/data-modification/backup-and-restore/CANCEL-RESTORE.md
+++
b/i18n/zh-CN/docusaurus-plugin-content-docs/version-4.x/sql-manual/sql-statements/data-modification/backup-and-restore/CANCEL-RESTORE.md
@@ -13,7 +13,7 @@
## 语法
```sql
-CANCEL RESTORE FROM <db_name>;
+CANCEL [GLOBAL] RESTORE [FROM <db_name>];
```
## 参数
@@ -34,3 +34,8 @@ CANCEL RESTORE FROM <db_name>;
CANCEL RESTORE FROM example_db;
```
+2. 取消 GLOBAL RESTORE 任务。
+
+```sql
+CANCEL GLOBAL RESTORE;
+```
diff --git
a/i18n/zh-CN/docusaurus-plugin-content-docs/version-4.x/sql-manual/sql-statements/data-modification/backup-and-restore/RESTORE.md
b/i18n/zh-CN/docusaurus-plugin-content-docs/version-4.x/sql-manual/sql-statements/data-modification/backup-and-restore/RESTORE.md
index 2bc5496f9b9..a2f04722e6f 100644
---
a/i18n/zh-CN/docusaurus-plugin-content-docs/version-4.x/sql-manual/sql-statements/data-modification/backup-and-restore/RESTORE.md
+++
b/i18n/zh-CN/docusaurus-plugin-content-docs/version-4.x/sql-manual/sql-statements/data-modification/backup-and-restore/RESTORE.md
@@ -13,7 +13,7 @@
## 语法
```sql
-RESTORE SNAPSHOT [<db_name>.]<snapshot_name>
+RESTORE [GLOBAL] SNAPSHOT [<db_name>.]<snapshot_name>
FROM `<repository_name>`
[ { ON | EXCLUDE } ] (
`<table_name>` [PARTITION (`<partition_name>`, ...)] [AS `<table_alias>`]
@@ -51,6 +51,9 @@ FROM `<repository_name>`
- "atomic_restore":先将数据加载到临时表中,再以原子方式替换原表,确保恢复过程中不影响目标表的读写。
- "force_replace":当表存在且架构与备份表不同时,强制替换。
- 注意,要启用 "force_replace",必须启用 "atomic_restore"
+- "reserve_privilege" = "true":是否恢复权限信息,与 `RESTORE GLOBAL` 一起使用。
+- "reserve_catalog" = "true":是否恢复 catalog 信息,与 `RESTORE GLOBAL` 一起使用。
+- "reserve_workload_group" = "true":是否恢复 workload group 信息,与 `RESTORE GLOBAL`
一起使用。
## 可选参数
@@ -128,3 +131,28 @@ PROPERTIES
);
```
+4. 从 example_repo 中恢复备份 snapshot_4 的权限、catalog 和 workload group 信息,时间版本为
"2018-05-04-18-12-18"。
+
+```sql
+RESTORE GLOBAL SNAPSHOT `snapshot_4`
+FROM `example_repo`
+EXCLUDE ( `backup_tbl` )
+PROPERTIES
+(
+ "backup_timestamp"="2018-05-04-18-12-18"
+);
+```
+
+5. 从 example_repo 中恢复备份 snapshot_5 的权限和 workload group 信息,时间版本为
"2018-05-04-18-12-18"。
+
+```sql
+RESTORE GLOBAL SNAPSHOT `snapshot_5`
+FROM `example_repo`
+EXCLUDE ( `backup_tbl` )
+PROPERTIES
+(
+ "backup_timestamp"="2018-05-04-18-12-18",
+ "reserve_privilege" = "true",
+ "reserve_workload_group" = "true"
+);
+```
diff --git
a/i18n/zh-CN/docusaurus-plugin-content-docs/version-4.x/sql-manual/sql-statements/data-modification/backup-and-restore/SHOW-RESTORE.md
b/i18n/zh-CN/docusaurus-plugin-content-docs/version-4.x/sql-manual/sql-statements/data-modification/backup-and-restore/SHOW-RESTORE.md
index 35920651f15..d15d4bfdd47 100644
---
a/i18n/zh-CN/docusaurus-plugin-content-docs/version-4.x/sql-manual/sql-statements/data-modification/backup-and-restore/SHOW-RESTORE.md
+++
b/i18n/zh-CN/docusaurus-plugin-content-docs/version-4.x/sql-manual/sql-statements/data-modification/backup-and-restore/SHOW-RESTORE.md
@@ -13,7 +13,7 @@
## 语法
```SQL
-SHOW [BRIEF] RESTORE [FROM <db_name>]
+SHOW [BRIEF] [GLOBAL] RESTORE [FROM <db_name>]
```
## 参数
@@ -56,3 +56,9 @@ SHOW [BRIEF] RESTORE [FROM <db_name>]
```sql
SHOW RESTORE FROM example_db;
```
+
+2. 查看最近一次 GLOBAL RESTORE 任务。
+
+```sql
+SHOW GLOBAL RESTORE;
+```
diff --git
a/versioned_docs/version-4.x/sql-manual/sql-statements/data-modification/backup-and-restore/BACKUP.md
b/versioned_docs/version-4.x/sql-manual/sql-statements/data-modification/backup-and-restore/BACKUP.md
index 986ddaf92ba..f86f2919fb1 100644
---
a/versioned_docs/version-4.x/sql-manual/sql-statements/data-modification/backup-and-restore/BACKUP.md
+++
b/versioned_docs/version-4.x/sql-manual/sql-statements/data-modification/backup-and-restore/BACKUP.md
@@ -8,12 +8,12 @@
## Description
-This statement is used to back up the data under the specified database. This
command is an asynchronous operation. After the submission is successful, you
need to check the progress through the [SHOW BACKUP](./SHOW-BACKUP.md) command.
+This statement is used to back up the data under the specified database. This
command is an asynchronous operation. After submission, you can check progress
with the `SHOW BACKUP` command.
## Syntax
```sql
-BACKUP SNAPSHOT [<db_name>.]<snapshot_name>
+BACKUP [GLOBAL] SNAPSHOT [<db_name>.]<snapshot_name>
TO `<repository_name>`
[ { ON | EXCLUDE } ]
( <table_name> [ PARTITION ( <partition_name> [, ...] ) ]
@@ -55,6 +55,9 @@ Data snapshot attributes, in the format: `<key>` =
`<value>`,currently support
- "type" = "full": indicates that this is a full update (default)
- "timeout" = "3600": The task timeout period, the default is one day. in
seconds.
+- "backup_privilege" = "true": Whether to back up privileges. Use with `BACKUP
GLOBAL`.
+- "backup_catalog" = "true": Whether to back up catalogs. Use with `BACKUP
GLOBAL`.
+- "backup_workload_group" = "true": Whether to back up workload groups. Use
with `BACKUP GLOBAL`.
## Access Control Requirements
@@ -107,3 +110,18 @@ EXCLUDE (example_tbl);
BACKUP SNAPSHOT example_db.snapshot_label3
TO example_repo;
```
+
+5. Back up privileges, catalogs, and workload groups to repository
example_repo:
+
+```sql
+BACKUP GLOBAL SNAPSHOT snapshot_label5
+TO example_repo;
+```
+
+6. Back up privileges and catalogs to repository example_repo:
+
+```sql
+BACKUP GLOBAL SNAPSHOT snapshot_label6
+TO example_repo
+PROPERTIES ("backup_privilege" = "true", "backup_catalog" = "true");
+```
diff --git
a/versioned_docs/version-4.x/sql-manual/sql-statements/data-modification/backup-and-restore/CANCEL-BACKUP.md
b/versioned_docs/version-4.x/sql-manual/sql-statements/data-modification/backup-and-restore/CANCEL-BACKUP.md
index 3a8a7fb6373..24f4ab4bbe7 100644
---
a/versioned_docs/version-4.x/sql-manual/sql-statements/data-modification/backup-and-restore/CANCEL-BACKUP.md
+++
b/versioned_docs/version-4.x/sql-manual/sql-statements/data-modification/backup-and-restore/CANCEL-BACKUP.md
@@ -13,7 +13,7 @@ This statement is used to cancel an ongoing BACKUP task.
## Syntax
```sql
-CANCEL BACKUP FROM <db_name>;
+CANCEL [GLOBAL] BACKUP [FROM <db_name>];
```
## Parameters
@@ -29,3 +29,9 @@ The name of the database to which the backup task belongs.
```sql
CANCEL BACKUP FROM example_db;
```
+
+2. Cancel the GLOBAL BACKUP task.
+
+```sql
+CANCEL GLOBAL BACKUP;
+```
diff --git
a/versioned_docs/version-4.x/sql-manual/sql-statements/data-modification/backup-and-restore/CANCEL-RESTORE.md
b/versioned_docs/version-4.x/sql-manual/sql-statements/data-modification/backup-and-restore/CANCEL-RESTORE.md
index 9988ac3e201..d6868d9cea6 100644
---
a/versioned_docs/version-4.x/sql-manual/sql-statements/data-modification/backup-and-restore/CANCEL-RESTORE.md
+++
b/versioned_docs/version-4.x/sql-manual/sql-statements/data-modification/backup-and-restore/CANCEL-RESTORE.md
@@ -13,7 +13,7 @@ This statement is used to cancel an ongoing RESTORE task.
## Syntax
```sql
-CANCEL RESTORE FROM <db_name>;
+CANCEL [GLOBAL] RESTORE [FROM <db_name>];
```
## Parameters
@@ -34,3 +34,8 @@ The name of the database to which the recovery task belongs.
CANCEL RESTORE FROM example_db;
```
+2. Cancel the GLOBAL RESTORE task.
+
+```sql
+CANCEL GLOBAL RESTORE;
+```
diff --git
a/versioned_docs/version-4.x/sql-manual/sql-statements/data-modification/backup-and-restore/RESTORE.md
b/versioned_docs/version-4.x/sql-manual/sql-statements/data-modification/backup-and-restore/RESTORE.md
index 81081a8497d..1be51285169 100644
---
a/versioned_docs/version-4.x/sql-manual/sql-statements/data-modification/backup-and-restore/RESTORE.md
+++
b/versioned_docs/version-4.x/sql-manual/sql-statements/data-modification/backup-and-restore/RESTORE.md
@@ -13,7 +13,7 @@ This statement is used to restore the data backed up by the
BACKUP command to th
## Syntax
```sql
-RESTORE SNAPSHOT [<db_name>.]<snapshot_name>
+RESTORE [GLOBAL] SNAPSHOT [<db_name>.]<snapshot_name>
FROM `<repository_name>`
[ { ON | EXCLUDE } ] (
`<table_name>` [PARTITION (`<partition_name>`, ...)] [AS `<table_alias>`]
@@ -53,6 +53,9 @@ Restoration operation attributes, the format is `<key>` =
`<value>`,currently
- "atomic_restore" - : The data will be loaded into a temporary table first,
and then the original table will be replaced atomically to ensure that the read
and write of the target table are not affected during the recovery process.
- "force_replace" : Force replace when the table exists and the schema is
different with the backup table.
- Note that to enable `force_replace`, you must enable `atomic_restore`
+- "reserve_privilege" = "true": Whether to restore privileges. Use with
`RESTORE GLOBAL`.
+- "reserve_catalog" = "true": Whether to restore catalogs. Use with `RESTORE
GLOBAL`.
+- "reserve_workload_group" = "true": Whether to restore workload groups. Use
with `RESTORE GLOBAL`.
## Optional Parameters
@@ -129,3 +132,29 @@ PROPERTIES
"backup_timestamp"="2018-05-04-18-12-18"
);
```
+
+4. Restore privileges, catalogs, and workload groups from backup snapshot_4 in
example_repo, with time version "2018-05-04-18-12-18".
+
+```sql
+RESTORE GLOBAL SNAPSHOT `snapshot_4`
+FROM `example_repo`
+EXCLUDE ( `backup_tbl` )
+PROPERTIES
+(
+ "backup_timestamp"="2018-05-04-18-12-18"
+);
+```
+
+5. Restore privileges and workload groups from backup snapshot_5 in
example_repo, with time version "2018-05-04-18-12-18".
+
+```sql
+RESTORE GLOBAL SNAPSHOT `snapshot_5`
+FROM `example_repo`
+EXCLUDE ( `backup_tbl` )
+PROPERTIES
+(
+ "backup_timestamp"="2018-05-04-18-12-18",
+ "reserve_privilege" = "true",
+ "reserve_workload_group" = "true"
+);
+```
diff --git
a/versioned_docs/version-4.x/sql-manual/sql-statements/data-modification/backup-and-restore/SHOW-RESTORE.md
b/versioned_docs/version-4.x/sql-manual/sql-statements/data-modification/backup-and-restore/SHOW-RESTORE.md
index 29e9878c3a6..9612a36a356 100644
---
a/versioned_docs/version-4.x/sql-manual/sql-statements/data-modification/backup-and-restore/SHOW-RESTORE.md
+++
b/versioned_docs/version-4.x/sql-manual/sql-statements/data-modification/backup-and-restore/SHOW-RESTORE.md
@@ -13,7 +13,7 @@ This statement is used to view RESTORE tasks
## Syntax
```SQL
-SHOW [BRIEF] RESTORE [FROM <db_name>]
+SHOW [BRIEF] [GLOBAL] RESTORE [FROM <db_name>]
```
## Parameters
@@ -57,3 +57,8 @@ The name of the database to which the recovery task belongs.
SHOW RESTORE FROM example_db;
```
+2. View the latest GLOBAL RESTORE task.
+
+```sql
+SHOW GLOBAL RESTORE;
+```
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]