This is an automated email from the ASF dual-hosted git repository.
yiguolei pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-doris.git
The following commit(s) were added to refs/heads/master by this push:
new 5f9b241999 [Refactor][doc] Modify the documentation of alter, backup
and restore in DDL (#8957)
5f9b241999 is described below
commit 5f9b2419990167cf4e581775e194bba8f9d27335
Author: smallhibiscus <[email protected]>
AuthorDate: Wed Apr 13 09:48:39 2022 +0800
[Refactor][doc] Modify the documentation of alter, backup and restore in
DDL (#8957)
---
.../Alter/ALTER-DATABASE.md | 56 +++++-
.../Alter/ALTER-TABLE-BITMAP.md | 86 ++++++++++
.../Alter/ALTER-TABLE-COLUMN.md | 189 ++++++++++++++++++++-
.../Alter/ALTER-TABLE-PARTITION.md | 131 +++++++++++++-
.../Alter/ALTER-TABLE-PROPERTY.md | 180 +++++++++++++++++++-
.../Alter/ALTER-TABLE-RENAME.md | 60 ++++++-
.../Alter/ALTER-TABLE-REPLACE.md | 21 ++-
.../Alter/ALTER-TABLE-ROLLUP.md | 94 +++++++++-
.../Data-Definition-Statements/Alter/ALTER-VIEW.md | 37 +++-
.../Alter/CANCEL-ALTER-TABLE.md | 72 ++++++++
.../Backup-and-Restore/BACKUP.md | 69 +++++++-
.../Backup-and-Restore/CANCEL-BACKUP.md | 21 ++-
.../Backup-and-Restore/CANCEL-RESTORE.md | 25 ++-
.../Backup-and-Restore/CREATE-REPOSITORY.md | 84 ++++++++-
.../Backup-and-Restore/DROP-REPOSITORY.md | 25 ++-
.../Backup-and-Restore/RECOVER.md | 78 +++++++++
.../Backup-and-Restore/RESTORE.md | 86 +++++++++-
.../Alter/ALTER-DATABASE.md | 57 ++++++-
.../Alter/ALTER-TABLE-BITMAP.md | 87 ++++++++++
.../Alter/ALTER-TABLE-COLUMN.md | 188 +++++++++++++++++++-
.../Alter/ALTER-TABLE-PARTITION.md | 130 +++++++++++++-
.../Alter/ALTER-TABLE-PROPERTY.md | 180 +++++++++++++++++++-
.../Alter/ALTER-TABLE-RENAME.md | 60 ++++++-
.../Alter/ALTER-TABLE-REPLACE.md | 21 ++-
.../Alter/ALTER-TABLE-ROLLUP.md | 94 +++++++++-
.../Data-Definition-Statements/Alter/ALTER-VIEW.md | 37 +++-
.../Alter/CANCEL-ALTER-TABLE.md | 72 ++++++++
.../Backup-and-Restore/BACKUP.md | 69 +++++++-
.../Backup-and-Restore/CANCEL-BACKUP.md | 18 ++
.../Backup-and-Restore/CANCEL-RESTORE.md | 22 +++
.../Backup-and-Restore/CREATE-REPOSITORY.md | 80 +++++++++
.../Backup-and-Restore/DROP-REPOSITORY.md | 22 +++
.../Backup-and-Restore/RECOVER.md | 40 +++++
.../Backup-and-Restore/RESTORE.md | 81 +++++++++
34 files changed, 2543 insertions(+), 29 deletions(-)
diff --git
a/new-docs/en/sql-manual/sql-reference-v2/Data-Definition-Statements/Alter/ALTER-DATABASE.md
b/new-docs/en/sql-manual/sql-reference-v2/Data-Definition-Statements/Alter/ALTER-DATABASE.md
index 527f4ac1ee..af2e0467e9 100644
---
a/new-docs/en/sql-manual/sql-reference-v2/Data-Definition-Statements/Alter/ALTER-DATABASE.md
+++
b/new-docs/en/sql-manual/sql-reference-v2/Data-Definition-Statements/Alter/ALTER-DATABASE.md
@@ -26,13 +26,67 @@ under the License.
## ALTER-DATABASE
+### Name
+
+ALTER DATABASE
+
### Description
+This statement is used to set properties of the specified database.
(administrator only)
+
+1) Set the database data quota, the unit is B/K/KB/M/MB/G/GB/T/TB/P/PB
+
+```sql
+ALTER DATABASE db_name SET DATA QUOTA quota;
+```
+
+2) Rename the database
+
+```sql
+ALTER DATABASE db_name RENAME new_db_name;
+```
+
+3) Set the quota for the number of copies of the database
+
+```sql
+ALTER DATABASE db_name SET REPLICA QUOTA quota;
+```
+
+illustrate:
+ After renaming the database, use the REVOKE and GRANT commands to modify
the appropriate user permissions, if necessary.
+ The default data quota for the database is 1024GB, and the default replica
quota is 1073741824.
+
### Example
+1. Set the specified database data volume quota
+
+```sql
+ALTER DATABASE example_db SET DATA QUOTA 10995116277760;
+The above unit is bytes, which is equivalent to
+ALTER DATABASE example_db SET DATA QUOTA 10T;
+
+ALTER DATABASE example_db SET DATA QUOTA 100G;
+
+ALTER DATABASE example_db SET DATA QUOTA 200M;
+```
+
+2. Rename the database example_db to example_db2
+
+```sql
+ALTER DATABASE example_db RENAME example_db2;
+```
+
+3. Set the quota for the number of copies of the specified database
+
+```sql
+ALTER DATABASE example_db SET REPLICA QUOTA 102400;
+```
+
### Keywords
- ALTER, DATABASE
+```text
+ALTER,DATABASE,RENAME
+```
### Best Practice
diff --git
a/new-docs/en/sql-manual/sql-reference-v2/Data-Definition-Statements/Alter/ALTER-TABLE-BITMAP.md
b/new-docs/en/sql-manual/sql-reference-v2/Data-Definition-Statements/Alter/ALTER-TABLE-BITMAP.md
new file mode 100644
index 0000000000..a37bbaf577
--- /dev/null
+++
b/new-docs/en/sql-manual/sql-reference-v2/Data-Definition-Statements/Alter/ALTER-TABLE-BITMAP.md
@@ -0,0 +1,86 @@
+---
+{
+ "title": "ALTER-TABLE-BITMAP",
+ "language": "en"
+}
+---
+
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+## ALTER-TABLE-BITMAP
+
+### Name
+
+ALTER TABLE BITMAP
+
+### Description
+
+This statement is used to perform a bitmap index operation on an existing
table.
+
+grammar:
+
+```sql
+ALTER TABLE [database.]table alter_clause;
+```
+
+The alter_clause of bitmap index supports the following modification methods
+
+1. Create a bitmap index
+
+ Syntax:
+
+```sql
+ADD INDEX [IF NOT EXISTS] index_name (column [, ...],) [USING BITMAP] [COMMENT
'balabala'];
+```
+
+Notice:
+
+- Currently only supports bitmap indexes
+- BITMAP indexes are only created on a single column
+
+2. Delete the index
+
+Syntax:
+
+```sql
+DROP INDEX [IF EXISTS] index_name;
+```
+
+### Example
+
+1. Create a bitmap index for siteid on table1
+
+```sql
+ALTER TABLE table1 ADD INDEX [IF NOT EXISTS] index_name (siteid) [USING
BITMAP] COMMENT 'balabala';
+```
+
+2. Delete the bitmap index of the siteid column on table1
+
+```sql
+ALTER TABLE table1 DROP INDEX [IF EXISTS] index_name;
+```
+
+### Keywords
+
+```text
+ALTER, TABLE, BITMAP
+```
+
+### Best Practice
diff --git
a/new-docs/en/sql-manual/sql-reference-v2/Data-Definition-Statements/Alter/ALTER-TABLE-COLUMN.md
b/new-docs/en/sql-manual/sql-reference-v2/Data-Definition-Statements/Alter/ALTER-TABLE-COLUMN.md
index 48fdae2ee0..499dc9b3b2 100644
---
a/new-docs/en/sql-manual/sql-reference-v2/Data-Definition-Statements/Alter/ALTER-TABLE-COLUMN.md
+++
b/new-docs/en/sql-manual/sql-reference-v2/Data-Definition-Statements/Alter/ALTER-TABLE-COLUMN.md
@@ -26,13 +26,198 @@ under the License.
## ALTER-TABLE-COLUMN
+### Name
+
+ALTER TABLE COLUMN
+
### Description
+This statement is used to perform a schema change operation on an existing
table. The schema change is asynchronous, and the task is returned when the
task is submitted successfully. After that, you can use the [SHOW
ALTER](../../Show-Statements/SHOW-ALTER.html) command to view the progress.
+
+grammar:
+
+```sql
+ALTER TABLE [database.]table alter_clause;
+```
+
+The alter_clause of schema change supports the following modification methods:
+
+1. Add a column to the specified position at the specified index
+
+grammar:
+
+```sql
+ADD COLUMN column_name column_type [KEY | agg_type] [DEFAULT "default_value"]
+[AFTER column_name|FIRST]
+[TO rollup_index_name]
+[PROPERTIES ("key"="value", ...)]
+```
+
+ Notice:
+
+- If you add a value column to the aggregation model, you need to specify
agg_type
+- For non-aggregated models (such as DUPLICATE KEY), if you add a key column,
you need to specify the KEY keyword
+- You cannot add columns that already exist in the base index to the rollup
index (you can recreate a rollup index if necessary)
+
+2. Add multiple columns to the specified index
+
+grammar:
+
+```sql
+ADD COLUMN (column_name1 column_type [KEY | agg_type] DEFAULT "default_value",
...)
+[TO rollup_index_name]
+[PROPERTIES ("key"="value", ...)]
+```
+
+Notice:
+
+- If you add a value column to the aggregation model, you need to specify
agg_type
+- If you add a key column to the aggregation model, you need to specify the
KEY keyword
+- You cannot add columns that already exist in the base index to the rollup
index (you can recreate a rollup index if necessary)
+
+3. Delete a column from the specified index
+
+grammar:
+
+```sql
+DROP COLUMN column_name
+[FROM rollup_index_name]
+```
+
+Notice:
+
+- Cannot drop partition column
+- If the column is removed from the base index, it will also be removed if it
is included in the rollup index
+
+4. Modify the column type and column position of the specified index
+
+ grammar:
+
+```sql
+MODIFY COLUMN column_name column_type [KEY | agg_type] [NULL | NOT NULL]
[DEFAULT "default_value"]
+[AFTER column_name|FIRST]
+[FROM rollup_index_name]
+[PROPERTIES ("key"="value", ...)]
+```
+
+Notice:
+
+- If you modify the value column in the aggregation model, you need to specify
agg_type
+- If you modify the key column for non-aggregate types, you need to specify
the KEY keyword
+- Only the type of the column can be modified, and other attributes of the
column remain as they are (that is, other attributes need to be explicitly
written in the statement according to the original attributes, see example 8)
+- Partitioning and bucketing columns cannot be modified in any way
+- The following types of conversions are currently supported (loss of
precision is guaranteed by the user)
+ - Conversion of TINYINT/SMALLINT/INT/BIGINT/LARGEINT/FLOAT/DOUBLE types to
larger numeric types
+ - Convert TINTINT/SMALLINT/INT/BIGINT/LARGEINT/FLOAT/DOUBLE/DECIMAL to
VARCHAR
+ - VARCHAR supports modifying the maximum length
+ - VARCHAR/CHAR converted to TINTINT/SMALLINT/INT/BIGINT/LARGEINT/FLOAT/DOUBLE
+ - Convert VARCHAR/CHAR to DATE (currently supports "%Y-%m-%d", "%y-%m-%d",
"%Y%m%d", "%y%m%d", "%Y/%m/%d, "%y/%m/%d" six formats)
+ - Convert DATETIME to DATE (only keep year-month-day information, for
example: `2019-12-09 21:47:05` <--> `2019-12-09`)
+ - DATE is converted to DATETIME (hours, minutes and seconds are
automatically filled with zeros, for example: `2019-12-09` <--> `2019-12-09
00:00:00`)
+ - Convert FLOAT to DOUBLE
+ - INT is converted to DATE (if the INT type data is illegal, the conversion
fails, and the original data remains unchanged)
+
+5. Reorder the column at the specified index
+
+grammar:
+
+```sql
+ORDER BY (column_name1, column_name2, ...)
+[FROM rollup_index_name]
+[PROPERTIES ("key"="value", ...)]
+```
+
+Notice:
+
+- All columns in index are written out
+- the value column comes after the key column
+
### Example
+1. Add a key column new_col after col1 of example_rollup_index (non-aggregated
model)
+
+```sql
+ALTER TABLE example_db.my_table
+ADD COLUMN new_col INT KEY DEFAULT "0" AFTER col1
+TO example_rollup_index;
+```
+
+2. Add a value column new_col after col1 of example_rollup_index
(non-aggregation model)
+
+```sql
+ALTER TABLE example_db.my_table
+ADD COLUMN new_col INT DEFAULT "0" AFTER col1
+TO example_rollup_index;
+```
+
+3. Add a key column new_col (aggregation model) after col1 of
example_rollup_index
+
+```sql
+ALTER TABLE example_db.my_table
+ADD COLUMN new_col INT DEFAULT "0" AFTER col1
+TO example_rollup_index;
+```
+
+4. Add a value column new_col SUM aggregation type (aggregation model) after
col1 of example_rollup_index
+
+```sql
+ALTER TABLE example_db.my_table
+ADD COLUMN new_col INT SUM DEFAULT "0" AFTER col1
+TO example_rollup_index;
+```
+
+5. Add multiple columns to example_rollup_index (aggregation model)
+
+```sql
+ALTER TABLE example_db.my_table
+ADD COLUMN (col1 INT DEFAULT "1", col2 FLOAT SUM DEFAULT "2.3")
+TO example_rollup_index;
+```
+
+6. Remove a column from example_rollup_index
+
+```sql
+ALTER TABLE example_db.my_table
+DROP COLUMN col2
+FROM example_rollup_index;
+```
+
+7. Modify the type of the key column col1 of the base index to BIGINT and move
it to the back of the col2 column.
+
+```sql
+ALTER TABLE example_db.my_table
+MODIFY COLUMN col1 BIGINT KEY DEFAULT "1" AFTER col2;
+```
+
+Note: Whether you modify the key column or the value column, you need to
declare complete column information
+
+8. Modify the maximum length of the val1 column of base index. The original
val1 is (val1 VARCHAR(32) REPLACE DEFAULT "abc")
+
+```sql
+ALTER TABLE example_db.my_table
+MODIFY COLUMN val1 VARCHAR(64) REPLACE DEFAULT "abc";
+```
+
+9. Reorder the columns in example_rollup_index (set the original column order
as: k1,k2,k3,v1,v2)
+
+```sql
+ALTER TABLE example_db.my_table
+ORDER BY (k3,k1,k2,v2,v1)
+FROM example_rollup_index;
+```
+
+10. Do Two Actions Simultaneously
+
+```sql
+ALTER TABLE example_db.my_table
+ADD COLUMN v2 INT MAX DEFAULT "0" AFTER k2 TO example_rollup_index,
+ORDER BY (k3,k1,k2,v2,v1) FROM example_rollup_index;
+```
+
### Keywords
- ALTER, TABLE, COLUMN
+```text
+ALTER, TABLE, COLUMN
+```
### Best Practice
-
diff --git
a/new-docs/en/sql-manual/sql-reference-v2/Data-Definition-Statements/Alter/ALTER-TABLE-PARTITION.md
b/new-docs/en/sql-manual/sql-reference-v2/Data-Definition-Statements/Alter/ALTER-TABLE-PARTITION.md
index df6150a5d0..cf0cb9caf4 100644
---
a/new-docs/en/sql-manual/sql-reference-v2/Data-Definition-Statements/Alter/ALTER-TABLE-PARTITION.md
+++
b/new-docs/en/sql-manual/sql-reference-v2/Data-Definition-Statements/Alter/ALTER-TABLE-PARTITION.md
@@ -26,13 +26,140 @@ under the License.
## ALTER-TABLE-PARTITION
+### Name
+
+ALTER TABLE PARTITION
+
### Description
+This statement is used to modify the partition of an existing table.
+
+This operation is synchronous, and the return of the command indicates the
completion of the execution.
+
+grammar:
+
+```sql
+ALTER TABLE [database.]table alter_clause;
+```
+
+The alter_clause of partition supports the following modification methods
+
+1. Add partition
+
+grammar:
+
+```sql
+ADD PARTITION [IF NOT EXISTS] partition_name
+partition_desc ["key"="value"]
+[DISTRIBUTED BY HASH (k1[,k2 ...]) [BUCKETS num]]
+```
+
+Notice:
+
+- partition_desc supports the following two ways of writing
+ - VALUES LESS THAN [MAXVALUE|("value1", ...)]
+ - VALUES [("value1", ...), ("value1", ...))
+- The partition is left closed and right open. If the user only specifies the
right boundary, the system will automatically determine the left boundary
+- If the bucketing method is not specified, the bucketing method used for
creating the table is automatically used
+- If the bucketing method is specified, only the number of buckets can be
modified, not the bucketing method or the bucketing column
+- The ["key"="value"] section can set some attributes of the partition, see
[CREATE
TABLE](./sql-manual/sql-reference-v2/Data-Definition-Statements/Create/CREATE-TABLE.html)
+- If the user does not explicitly create a partition when creating a table,
adding a partition by ALTER is not supported
+
+2. Delete the partition
+
+grammar:
+
+```sql
+DROP PARTITION [IF EXISTS] partition_name [FORCE]
+```
+
+ Notice:
+
+- At least one partition must be reserved for tables using partitioning.
+- After executing DROP PARTITION for a period of time, the deleted partition
can be recovered through the RECOVER statement. For details, see SQL Manual -
Database Management - RECOVER Statement
+- If you execute DROP PARTITION FORCE, the system will not check whether there
are unfinished transactions in the partition, the partition will be deleted
directly and cannot be recovered, this operation is generally not recommended
+
+3. Modify the partition properties
+
+ grammar:
+
+```sql
+MODIFY PARTITION p1|(p1[, p2, ...]) SET ("key" = "value", ...)
+```
+
+illustrate:
+
+- Currently supports modifying the following properties of partitions:
+ - storage_medium
+ -storage_cooldown_time
+ - replication_num
+ - in_memory
+- For single-partition tables, partition_name is the same as the table name.
+
### Example
+1. Add partition, existing partition [MIN, 2013-01-01), add partition
[2013-01-01, 2014-01-01), use default bucketing method
+
+```sql
+ALTER TABLE example_db.my_table
+ADD PARTITION p1 VALUES LESS THAN ("2014-01-01");
+```
+
+2. Increase the partition and use the new number of buckets
+
+```sql
+ALTER TABLE example_db.my_table
+ADD PARTITION p1 VALUES LESS THAN ("2015-01-01")
+DISTRIBUTED BY HASH(k1) BUCKETS 20;
+```
+
+3. Increase the partition and use the new number of replicas
+
+```sql
+ALTER TABLE example_db.my_table
+ADD PARTITION p1 VALUES LESS THAN ("2015-01-01")
+("replication_num"="1");
+```
+
+4. Modify the number of partition replicas
+
+```sql
+ALTER TABLE example_db.my_table
+MODIFY PARTITION p1 SET("replication_num"="1");
+```
+
+5. Batch modify the specified partition
+
+```sql
+ALTER TABLE example_db.my_table
+MODIFY PARTITION (p1, p2, p4) SET("in_memory"="true");
+```
+
+6. Batch modify all partitions
+
+```sql
+ALTER TABLE example_db.my_table
+MODIFY PARTITION (*) SET("storage_medium"="HDD");
+```
+
+7. Delete partition
+
+```sql
+ALTER TABLE example_db.my_table
+DROP PARTITION p1;
+```
+
+8. Add a partition specifying upper and lower bounds
+
+```sql
+ALTER TABLE example_db.my_table
+ADD PARTITION p1 VALUES [("2014-01-01"), ("2014-02-01"));
+```
+
### Keywords
- ALTER, TABLE, PARTITION
+```text
+ALTER, TABLE, PARTITION
+```
### Best Practice
-
diff --git
a/new-docs/en/sql-manual/sql-reference-v2/Data-Definition-Statements/Alter/ALTER-TABLE-PROPERTY.md
b/new-docs/en/sql-manual/sql-reference-v2/Data-Definition-Statements/Alter/ALTER-TABLE-PROPERTY.md
index fe094ecab3..2cfb548303 100644
---
a/new-docs/en/sql-manual/sql-reference-v2/Data-Definition-Statements/Alter/ALTER-TABLE-PROPERTY.md
+++
b/new-docs/en/sql-manual/sql-reference-v2/Data-Definition-Statements/Alter/ALTER-TABLE-PROPERTY.md
@@ -26,13 +26,191 @@ under the License.
## ALTER-TABLE-PROPERTY
+### Name
+
+ALTER TABLE PROPERTY
+
### Description
+This statement is used to modify the properties of an existing table. This
operation is synchronous, and the return of the command indicates the
completion of the execution.
+
+grammar:
+
+```sql
+ALTER TABLE [database.]table alter_clause;
+```
+
+The alter_clause of property supports the following modification methods
+
+1. Modify the bloom filter column of the table
+
+```sql
+ALTER TABLE example_db.my_table SET ("bloom_filter_columns"="k1,k2,k3");
+```
+
+Can also be incorporated into the schema change operation above (note that the
syntax for multiple clauses is slightly different)
+
+```sql
+ALTER TABLE example_db.my_table
+DROP COLUMN col2
+PROPERTIES ("bloom_filter_columns"="k1,k2,k3");
+```
+
+2. Modify the Colocate property of the table
+
+```sql
+ALTER TABLE example_db.my_table set ("colocate_with" = "t1");
+```
+
+3. Change the bucketing method of the table from Hash Distribution to Random
Distribution
+
+```sql
+ALTER TABLE example_db.my_table set ("distribution_type" = "random");
+```
+
+4. Modify the dynamic partition attribute of the table (support adding dynamic
partition attribute to the table without dynamic partition attribute)
+
+```sql
+ALTER TABLE example_db.my_table set ("dynamic_partition.enable" = "false");
+```
+
+If you need to add dynamic partition attributes to tables without dynamic
partition attributes, you need to specify all dynamic partition attributes
+ (Note: adding dynamic partition attributes is not supported for
non-partitioned tables)
+
+```sql
+ALTER TABLE example_db.my_table set ("dynamic_partition.enable" = "true",
"dynamic_partition.time_unit" = "DAY", "dynamic_partition.end" = "3",
"dynamic_partition.prefix" = "p", "dynamic_partition. buckets" = "32");
+```
+
+5. Modify the in_memory attribute of the table
+
+```sql
+ALTER TABLE example_db.my_table set ("in_memory" = "true");
+```
+
+6. Enable batch delete function
+
+```sql
+ALTER TABLE example_db.my_table ENABLE FEATURE "BATCH_DELETE";
+```
+
+7. Enable the function of ensuring the import order according to the value of
the sequence column
+
+```sql
+ALTER TABLE example_db.my_table ENABLE FEATURE "SEQUENCE_LOAD" WITH PROPERTIES
("function_column.sequence_type" = "Date");
+```
+
+8. Change the default number of buckets for the table to 50
+
+```sql
+ALTER TABLE example_db.my_table MODIFY DISTRIBUTION DISTRIBUTED BY HASH(k1)
BUCKETS 50;
+```
+
+9. Modify table comments
+
+```sql
+ALTER TABLE example_db.my_table MODIFY COMMENT "new comment";
+```
+
+10. Modify column comments
+
+```sql
+ALTER TABLE example_db.my_table MODIFY COLUMN k1 COMMENT "k1", MODIFY COLUMN
k2 COMMENT "k2";
+```
+
+11. Modify the engine type
+
+```sql
+ALTER TABLE example_db.mysql_table MODIFY ENGINE TO odbc PROPERTIES("driver" =
"MySQL");
+```
+
### Example
+1. Modify the bloom filter column of the table
+
+```sql
+ALTER TABLE example_db.my_table SET ("bloom_filter_columns"="k1,k2,k3");
+```
+
+Can also be incorporated into the schema change operation above (note that the
syntax for multiple clauses is slightly different)
+
+```sql
+ALTER TABLE example_db.my_table
+DROP COLUMN col2
+PROPERTIES ("bloom_filter_columns"="k1,k2,k3");
+```
+
+2. Modify the Colocate property of the table
+
+```sql
+ALTER TABLE example_db.my_table set ("colocate_with" = "t1");
+```
+
+3. Change the bucketing method of the table from Hash Distribution to Random
Distribution
+
+```sql
+ALTER TABLE example_db.my_table set ("distribution_type" = "random");
+```
+
+4. Modify the dynamic partition attribute of the table (support adding dynamic
partition attribute to the table without dynamic partition attribute)
+
+```sql
+ALTER TABLE example_db.my_table set ("dynamic_partition.enable" = "false");
+```
+
+If you need to add dynamic partition attributes to tables without dynamic
partition attributes, you need to specify all dynamic partition attributes
+ (Note: adding dynamic partition attributes is not supported for
non-partitioned tables)
+
+```sql
+ALTER TABLE example_db.my_table set ("dynamic_partition.enable" = "true",
"dynamic_partition.time_unit" = "DAY", "dynamic_partition.end" = "3",
"dynamic_partition.prefix" = "p", "dynamic_partition. buckets" = "32");
+```
+
+5. Modify the in_memory attribute of the table
+
+```sql
+ALTER TABLE example_db.my_table set ("in_memory" = "true");
+```
+
+6. Enable batch delete function
+
+```sql
+ALTER TABLE example_db.my_table ENABLE FEATURE "BATCH_DELETE";
+```
+
+7. Enable the function of ensuring the import order according to the value of
the sequence column
+
+```sql
+ALTER TABLE example_db.my_table ENABLE FEATURE "SEQUENCE_LOAD" WITH PROPERTIES
("function_column.sequence_type" = "Date");
+```
+
+8. Change the default number of buckets for the table to 50
+
+```sql
+ALTER TABLE example_db.my_table MODIFY DISTRIBUTION DISTRIBUTED BY HASH(k1)
BUCKETS 50;
+```
+
+9. Modify table comments
+
+```sql
+ALTER TABLE example_db.my_table MODIFY COMMENT "new comment";
+```
+
+10. Modify column comments
+
+```sql
+ALTER TABLE example_db.my_table MODIFY COLUMN k1 COMMENT "k1", MODIFY COLUMN
k2 COMMENT "k2";
+```
+
+11. Modify the engine type
+
+```sql
+ALTER TABLE example_db.mysql_table MODIFY ENGINE TO odbc PROPERTIES("driver" =
"MySQL");
+```
+
### Keywords
- ALTER, TABLE, PROPERTY
+```text
+ALTER, TABLE, PROPERTY
+```
### Best Practice
diff --git
a/new-docs/en/sql-manual/sql-reference-v2/Data-Definition-Statements/Alter/ALTER-TABLE-RENAME.md
b/new-docs/en/sql-manual/sql-reference-v2/Data-Definition-Statements/Alter/ALTER-TABLE-RENAME.md
index dfaae33b28..8eede30f1a 100644
---
a/new-docs/en/sql-manual/sql-reference-v2/Data-Definition-Statements/Alter/ALTER-TABLE-RENAME.md
+++
b/new-docs/en/sql-manual/sql-reference-v2/Data-Definition-Statements/Alter/ALTER-TABLE-RENAME.md
@@ -26,13 +26,71 @@ under the License.
## ALTER-TABLE-RENAME
+### Name
+
+ALTER TABLE RENAME
+
### Description
+This statement is used to rename certain names of existing table properties.
This operation is synchronous, and the return of the command indicates the
completion of the execution.
+
+grammar:
+
+```sql
+ALTER TABLE [database.]table alter_clause;
+```
+
+The alter_clause of rename supports modification of the following names
+
+1. Modify the table name
+
+grammar:
+
+```sql
+RENAME new_table_name;
+```
+
+2. Modify the rollup index name
+
+ grammar:
+
+```sql
+RENAME ROLLUP old_rollup_name new_rollup_name;
+```
+
+3. Modify the partition name
+
+grammar:
+
+```sql
+RENAME PARTITION old_partition_name new_partition_name;
+```
+
### Example
+1. Modify the table named table1 to table2
+
+```sql
+ALTER TABLE table1 RENAME table2;
+```
+
+2. Modify the rollup index named rollup1 in the table example_table to rollup2
+
+```sql
+ALTER TABLE example_table RENAME ROLLUP rollup1 rollup2;
+```
+
+3. Modify the partition named p1 in the table example_table to p2
+
+```sql
+ALTER TABLE example_table RENAME PARTITION p1 p2;
+```
+
### Keywords
- ALTER, TABLE, RENAME
+```text
+ALTER, TABLE, RENAME
+```
### Best Practice
diff --git
a/new-docs/en/sql-manual/sql-reference-v2/Data-Definition-Statements/Alter/ALTER-TABLE-REPLACE.md
b/new-docs/en/sql-manual/sql-reference-v2/Data-Definition-Statements/Alter/ALTER-TABLE-REPLACE.md
index e383908221..1d140b172b 100644
---
a/new-docs/en/sql-manual/sql-reference-v2/Data-Definition-Statements/Alter/ALTER-TABLE-REPLACE.md
+++
b/new-docs/en/sql-manual/sql-reference-v2/Data-Definition-Statements/Alter/ALTER-TABLE-REPLACE.md
@@ -26,13 +26,32 @@ under the License.
## ALTER-TABLE-REPLACE
+### Name
+
+ALTER TABLE REPLACE
+
### Description
+This statement is used to modify the attributes of the schema of the existing
table. The syntax is basically similar to [ALTER TABLE
CULUMN](ALTER-TABLE-COLUMN.html).
+
+```sql
+ALTER TABLE [database.]table MODIFY NEW_COLUMN_INFO REPLACE OLD_COLUMN_INFO ;
+```
+
### Example
+1. Modify the maximum length of the val1 column of base index. The original
val1 is (val1 VARCHAR(32) REPLACE DEFAULT "abc")
+
+```sql
+ALTER TABLE example_db.my_table
+MODIFY COLUMN val1 VARCHAR(64) REPLACE DEFAULT "abc";
+```
+
### Keywords
- ALTER, TABLE, REPLACE
+```text
+ALTER, TABLE, REPLACE
+```
### Best Practice
diff --git
a/new-docs/en/sql-manual/sql-reference-v2/Data-Definition-Statements/Alter/ALTER-TABLE-ROLLUP.md
b/new-docs/en/sql-manual/sql-reference-v2/Data-Definition-Statements/Alter/ALTER-TABLE-ROLLUP.md
index 99ab24c164..f06a600c76 100644
---
a/new-docs/en/sql-manual/sql-reference-v2/Data-Definition-Statements/Alter/ALTER-TABLE-ROLLUP.md
+++
b/new-docs/en/sql-manual/sql-reference-v2/Data-Definition-Statements/Alter/ALTER-TABLE-ROLLUP.md
@@ -26,13 +26,105 @@ under the License.
## ALTER-TABLE-ROLLUP
+### Name
+
+ALTER TABLE ROLLUP
+
### Description
+This statement is used to perform a rollup modification operation on an
existing table. The rollup is an asynchronous operation, and the task is
returned when the task is submitted successfully. After that, you can use the
[SHOW ALTER](../../Show-Statements/SHOW-ALTER.html) command to view the
progress.
+
+grammar:
+
+```sql
+ALTER TABLE [database.]table alter_clause;
+```
+
+The alter_clause of rollup supports the following creation methods
+
+1. Create a rollup index
+
+grammar:
+
+```sql
+ADD ROLLUP rollup_name (column_name1, column_name2, ...)
+[FROM from_index_name]
+[PROPERTIES ("key"="value", ...)]
+```
+
+2. Create rollup indexes in batches
+
+grammar:
+
+```sql
+ADD ROLLUP [rollup_name (column_name1, column_name2, ...)
+ [FROM from_index_name]
+ [PROPERTIES ("key"="value", ...)],...]
+```
+
+Notice:
+
+- If from_index_name is not specified, it will be created from base index by
default
+- Columns in rollup table must be columns already in from_index
+- In properties, the storage format can be specified. For details, see [CREATE
TABLE](../Create/CREATE-TABLE.html#create-table)
+
+3. Delete rollup index
+
+ grammar:
+
+```sql
+DROP ROLLUP rollup_name [PROPERTIES ("key"="value", ...)]
+```
+
+4. Batch delete rollup index
+
+grammar:
+
+```sql
+DROP ROLLUP [rollup_name [PROPERTIES ("key"="value", ...)],...]
+```
+
+Notice:
+
+- cannot delete base index
+
### Example
+1. Create index: example_rollup_index, based on base index (k1,k2,k3,v1,v2).
Columnar storage.
+
+```sql
+ALTER TABLE example_db.my_table
+ADD ROLLUP example_rollup_index(k1, k3, v1, v2);
+```
+
+2. Create index: example_rollup_index2, based on example_rollup_index
(k1,k3,v1,v2)
+
+```sql
+ALTER TABLE example_db.my_table
+ADD ROLLUP example_rollup_index2 (k1, v1)
+FROM example_rollup_index;
+```
+
+3. Create index: example_rollup_index3, based on base index (k1,k2,k3,v1),
with a custom rollup timeout of one hour.
+
+```sql
+ALTER TABLE example_db.my_table
+ADD ROLLUP example_rollup_index(k1, k3, v1)
+PROPERTIES("timeout" = "3600");
+```
+
+4. Delete index: example_rollup_index2
+
+```sql
+ALTER TABLE example_db.my_table
+DROP ROLLUP example_rollup_index2;
+```
+
### Keywords
- ALTER, TABLE, ROLLUP
+```text
+ALTER, TABLE, ROLLUP
+```
### Best Practice
diff --git
a/new-docs/en/sql-manual/sql-reference-v2/Data-Definition-Statements/Alter/ALTER-VIEW.md
b/new-docs/en/sql-manual/sql-reference-v2/Data-Definition-Statements/Alter/ALTER-VIEW.md
index 23ab56ba07..b471b034e1 100644
---
a/new-docs/en/sql-manual/sql-reference-v2/Data-Definition-Statements/Alter/ALTER-VIEW.md
+++
b/new-docs/en/sql-manual/sql-reference-v2/Data-Definition-Statements/Alter/ALTER-VIEW.md
@@ -26,13 +26,48 @@ under the License.
## ALTER-VIEW
+### Name
+
+ALTER VIEW
+
### Description
+This statement is used to modify the definition of a view
+
+grammar:
+
+```sql
+ALTER VIEW
+[db_name.]view_name
+(column1[ COMMENT "col comment"][, column2, ...])
+AS query_stmt
+```
+
+illustrate:
+
+- Views are all logical, and the data in them will not be stored on physical
media. When querying, the view will be used as a subquery in the statement.
Therefore, modifying the definition of the view is equivalent to modifying
query_stmt.
+- query_stmt is any supported SQL
+
### Example
+1. Modify the view example_view on example_db
+
+```sql
+ALTER VIEW example_db.example_view
+(
+c1 COMMENT "column 1",
+c2 COMMENT "column 2",
+c3 COMMENT "column 3"
+)
+AS SELECT k1, k2, SUM(v1) FROM example_table
+GROUP BY k1, k2
+```
+
### Keywords
- ALTER, VIEW
+```text
+ALTER, VIEW
+```
### Best Practice
diff --git
a/new-docs/en/sql-manual/sql-reference-v2/Data-Definition-Statements/Alter/CANCEL-ALTER-TABLE.md
b/new-docs/en/sql-manual/sql-reference-v2/Data-Definition-Statements/Alter/CANCEL-ALTER-TABLE.md
index ca6777e2fb..9f8cd0b0f1 100644
---
a/new-docs/en/sql-manual/sql-reference-v2/Data-Definition-Statements/Alter/CANCEL-ALTER-TABLE.md
+++
b/new-docs/en/sql-manual/sql-reference-v2/Data-Definition-Statements/Alter/CANCEL-ALTER-TABLE.md
@@ -26,10 +26,82 @@ under the License.
## CANCEL-ALTER-TABLE
+### Name
+
+CANCEL ALTER TABLE
+
### Description
+This statement is used to undo an ALTER operation.
+
+1. Undo the ALTER TABLE COLUMN operation
+
+grammar:
+
+```sql
+CANCEL ALTER TABLE COLUMN
+FROM db_name.table_name
+```
+
+2. Undo the ALTER TABLE ROLLUP operation
+
+grammar:
+
+```sql
+CANCEL ALTER TABLE ROLLUP
+FROM db_name.table_name
+```
+
+3. Batch cancel rollup operations based on job id
+
+grammar:
+
+```sql
+CANCEL ALTER TABLE ROLLUP
+FROM db_name.table_name (jobid,...)
+```
+
+Notice:
+
+- This command is an asynchronous operation. You need to use `show alter table
rollup` to check the task status to confirm whether the execution is successful
or not.
+
+4. Undo the ALTER CLUSTER operation
+
+grammar:
+
+```
+(To be implemented...)
+```
+
### Example
+1. Undo the ALTER COLUMN operation on my_table.
+
+ [CANCEL ALTER TABLE COLUMN]
+
+```sql
+CANCEL ALTER TABLE COLUMN
+FROM example_db.my_table;
+```
+
+1. Undo the ADD ROLLUP operation under my_table.
+
+ [CANCEL ALTER TABLE ROLLUP]
+
+```sql
+CANCEL ALTER TABLE ROLLUP
+FROM example_db.my_table;
+```
+
+1. Undo the ADD ROLLUP operation under my_table according to the job id.
+
+ [CANCEL ALTER TABLE ROLLUP]
+
+```sql
+CANCEL ALTER TABLE ROLLUP
+FROM example_db.my_table(12801,12802);
+```
+
### Keywords
CANCEL, ALTER, TABLE
diff --git
a/new-docs/en/sql-manual/sql-reference-v2/Data-Definition-Statements/Backup-and-Restore/BACKUP.md
b/new-docs/en/sql-manual/sql-reference-v2/Data-Definition-Statements/Backup-and-Restore/BACKUP.md
index e4f00c442c..41057a90ca 100644
---
a/new-docs/en/sql-manual/sql-reference-v2/Data-Definition-Statements/Backup-and-Restore/BACKUP.md
+++
b/new-docs/en/sql-manual/sql-reference-v2/Data-Definition-Statements/Backup-and-Restore/BACKUP.md
@@ -26,13 +26,80 @@ under the License.
## BACKUP
+### Name
+
+BACKUP
+
### 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 command. Only backing up
tables of type OLAP is supported.
+
+grammar:
+
+```sql
+BACKUP SNAPSHOT [db_name].{snapshot_name}
+TO `repository_name`
+[ON|EXCLUDE] (
+ `table_name` [PARTITION (`p1`, ...)],
+ ...
+)
+PROPERTIES ("key"="value", ...);
+```
+
+illustrate:
+
+- There can only be one executing BACKUP or RESTORE task under the same
database.
+- The ON clause identifies the tables and partitions that need to be backed
up. If no partition is specified, all partitions of the table are backed up by
default
+- Tables and partitions that do not require backup are identified in the
EXCLUDE clause. Back up all partition data for all tables in this database
except the specified table or partition.
+- PROPERTIES currently supports the following properties:
+ - "type" = "full": indicates that this is a full update (default)
+ - "timeout" = "3600": The task timeout period, the default is one day. in
seconds.
+
### Example
+1. Fully backup the table example_tbl under example_db to the warehouse
example_repo:
+
+```sql
+BACKUP SNAPSHOT example_db.snapshot_label1
+TO example_repo
+ON (example_tbl)
+PROPERTIES ("type" = "full");
+```
+
+2. Under the full backup example_db, the p1, p2 partitions of the table
example_tbl, and the table example_tbl2 to the warehouse example_repo:
+
+```sql
+BACKUP SNAPSHOT example_db.snapshot_label2
+TO example_repo
+ON
+(
+ example_tbl PARTITION (p1,p2),
+ example_tbl2
+);
+```
+
+3. Full backup of all tables except table example_tbl under example_db to
warehouse example_repo:
+
+```sql
+BACKUP SNAPSHOT example_db.snapshot_label3
+TO example_repo
+EXCLUDE (example_tbl);
+```
+
### Keywords
- BACKUP
+```text
+BACKUP
+```
### Best Practice
+1. Only one backup operation can be performed under the same database.
+
+2. The backup operation will back up the underlying table and [materialized
view](../../../../advanced/materialized-view.html) of the specified table or
partition, and only one copy will be backed up.
+
+3. Efficiency of backup operations
+
+ The efficiency of backup operations depends on the amount of data, the
number of Compute Nodes, and the number of files. Each Compute Node where the
backup data shard is located will participate in the upload phase of the backup
operation. The greater the number of nodes, the higher the upload efficiency.
+
+ The amount of file data refers only to the number of shards, and the number
of files in each shard. If there are many shards, or there are many small files
in the shards, the backup operation time may be increased.
diff --git
a/new-docs/en/sql-manual/sql-reference-v2/Data-Definition-Statements/Backup-and-Restore/CANCEL-BACKUP.md
b/new-docs/en/sql-manual/sql-reference-v2/Data-Definition-Statements/Backup-and-Restore/CANCEL-BACKUP.md
index bb6d9448fc..9ecbc9b9c2 100644
---
a/new-docs/en/sql-manual/sql-reference-v2/Data-Definition-Statements/Backup-and-Restore/CANCEL-BACKUP.md
+++
b/new-docs/en/sql-manual/sql-reference-v2/Data-Definition-Statements/Backup-and-Restore/CANCEL-BACKUP.md
@@ -26,13 +26,30 @@ under the License.
## CANCEL-BACKUP
+### Name
+
+CANCEL BACKUP
+
### Description
+This statement is used to cancel an ongoing BACKUP task.
+
+grammar:
+
+```sql
+CANCEL BACKUP FROM db_name;
+```
+
### Example
+1. Cancel the BACKUP task under example_db.
+
+```sql
+CANCEL BACKUP FROM example_db;
+```
+
### Keywords
- CANCEL, BACKUP
+ CANCEL, BACKUP
### Best Practice
-
diff --git
a/new-docs/en/sql-manual/sql-reference-v2/Data-Definition-Statements/Backup-and-Restore/CANCEL-RESTORE.md
b/new-docs/en/sql-manual/sql-reference-v2/Data-Definition-Statements/Backup-and-Restore/CANCEL-RESTORE.md
index fa50eca878..fbc0e9d315 100644
---
a/new-docs/en/sql-manual/sql-reference-v2/Data-Definition-Statements/Backup-and-Restore/CANCEL-RESTORE.md
+++
b/new-docs/en/sql-manual/sql-reference-v2/Data-Definition-Statements/Backup-and-Restore/CANCEL-RESTORE.md
@@ -26,13 +26,34 @@ under the License.
## CANCEL-RESTORE
+### Name
+
+CANCEL RESTORE
+
### Description
+This statement is used to cancel an ongoing RESTORE task.
+
+grammar:
+
+```sql
+CANCEL RESTORE FROM db_name;
+```
+
+Notice:
+
+- When cancellation is around a COMMIT or later stage of recovery, the table
being recovered may be rendered inaccessible. At this time, data recovery can
only be performed by executing the recovery job again.
+
### Example
+1. Cancel the RESTORE task under example_db.
+
+```sql
+CANCEL RESTORE FROM example_db;
+```
+
### Keywords
- CANCEL, RESTORE
+ CANCEL, RESTORE
### Best Practice
-
diff --git
a/new-docs/en/sql-manual/sql-reference-v2/Data-Definition-Statements/Backup-and-Restore/CREATE-REPOSITORY.md
b/new-docs/en/sql-manual/sql-reference-v2/Data-Definition-Statements/Backup-and-Restore/CREATE-REPOSITORY.md
index 611bfab2fc..3f12e66a02 100644
---
a/new-docs/en/sql-manual/sql-reference-v2/Data-Definition-Statements/Backup-and-Restore/CREATE-REPOSITORY.md
+++
b/new-docs/en/sql-manual/sql-reference-v2/Data-Definition-Statements/Backup-and-Restore/CREATE-REPOSITORY.md
@@ -26,13 +26,95 @@ under the License.
## CREATE-REPOSITORY
+### Name
+
+CREATE REPOSITORY
+
### Description
+This statement is used to create a repository. Repositories are used for
backup or restore. Only root or superuser users can create repositories.
+
+grammar:
+
+```sql
+CREATE [READ ONLY] REPOSITORY `repo_name`
+WITH [BROKER `broker_name`|S3]
+ON LOCATION `repo_location`
+PROPERTIES ("key"="value", ...);
+```
+
+illustrate:
+
+- Creation of repositories, relying on existing brokers or accessing cloud
storage directly through AWS s3 protocol
+- If it is a read-only repository, restores can only be done on the
repository. If not, backup and restore operations are available.
+- PROPERTIES are different according to different types of broker or S3, see
the example for details.
+
### Example
+1. Create a warehouse named bos_repo, rely on BOS broker "bos_broker", and the
data root directory is: bos://palo_backup
+
+```sql
+CREATE REPOSITORY `bos_repo`
+WITH BROKER `bos_broker`
+ON LOCATION "bos://palo_backup"
+PROPERTIES
+(
+ "bos_endpoint" = "http://gz.bcebos.com",
+ "bos_accesskey" = "bos_accesskey",
+ "bos_secret_accesskey"="bos_secret_accesskey"
+);
+```
+
+2. Create the same repository as Example 1, but with read-only properties:
+
+```sql
+CREATE READ ONLY REPOSITORY `bos_repo`
+WITH BROKER `bos_broker`
+ON LOCATION "bos://palo_backup"
+PROPERTIES
+(
+ "bos_endpoint" = "http://gz.bcebos.com",
+ "bos_accesskey" = "bos_accesskey",
+ "bos_secret_accesskey"="bos_accesskey"
+);
+```
+
+3. Create a warehouse named hdfs_repo, rely on Baidu hdfs broker
"hdfs_broker", the data root directory is:
hdfs://hadoop-name-node:54310/path/to/repo/
+
+```sql
+CREATE REPOSITORY `hdfs_repo`
+WITH BROKER `hdfs_broker`
+ON LOCATION "hdfs://hadoop-name-node:54310/path/to/repo/"
+PROPERTIES
+(
+ "username" = "user",
+ "password" = "password"
+);
+```
+
+4. Create a repository named s3_repo to link cloud storage directly without
going through the broker.
+
+```sql
+CREATE REPOSITORY `s3_repo`
+WITH S3
+ON LOCATION "s3://s3-repo"
+PROPERTIES
+(
+ "AWS_ENDPOINT" = "http://s3-REGION.amazonaws.com",
+ "AWS_ACCESS_KEY" = "AWS_ACCESS_KEY",
+ "AWS_SECRET_KEY"="AWS_SECRET_KEY",
+ "AWS_REGION" = "REGION"
+);
+```
+
### Keywords
- CREATE, REPOSITORY
+```
+CREATE, REPOSITORY
+```
### Best Practice
+1. A cluster can create multiple warehouses. Only users with ADMIN privileges
can create repositories.
+2. Any user can view the created repositories through the [SHOW
REPOSITORIES](../../Show-Statements/SHOW-REPOSITORIES.html) command.
+3. When performing data migration operations, it is necessary to create the
exact same warehouse in the source cluster and the destination cluster, so that
the destination cluster can view the data snapshots backed up by the source
cluster through this warehouse.
diff --git
a/new-docs/en/sql-manual/sql-reference-v2/Data-Definition-Statements/Backup-and-Restore/DROP-REPOSITORY.md
b/new-docs/en/sql-manual/sql-reference-v2/Data-Definition-Statements/Backup-and-Restore/DROP-REPOSITORY.md
index adf837436a..6a7e6e5a66 100644
---
a/new-docs/en/sql-manual/sql-reference-v2/Data-Definition-Statements/Backup-and-Restore/DROP-REPOSITORY.md
+++
b/new-docs/en/sql-manual/sql-reference-v2/Data-Definition-Statements/Backup-and-Restore/DROP-REPOSITORY.md
@@ -26,13 +26,34 @@ under the License.
## DROP-REPOSITORY
+### Name
+
+DROP REPOSITORY
+
### Description
+This statement is used to delete a created repository. Only root or superuser
users can delete repositories.
+
+grammar:
+
+```sql
+DROP REPOSITORY `repo_name`;
+```
+
+illustrate:
+
+- Deleting a warehouse just deletes the warehouse's mapping in Palo, not the
actual warehouse data. Once deleted, it can be mapped to the repository again
by specifying the same broker and LOCATION.
+
### Example
+1. Delete the repository named bos_repo:
+
+```sql
+DROP REPOSITORY `bos_repo`;
+```
+
### Keywords
- DROP, REPOSITORY
+ DROP, REPOSITORY
### Best Practice
-
diff --git
a/new-docs/en/sql-manual/sql-reference-v2/Data-Definition-Statements/Backup-and-Restore/RECOVER.md
b/new-docs/en/sql-manual/sql-reference-v2/Data-Definition-Statements/Backup-and-Restore/RECOVER.md
new file mode 100644
index 0000000000..5769c8c843
--- /dev/null
+++
b/new-docs/en/sql-manual/sql-reference-v2/Data-Definition-Statements/Backup-and-Restore/RECOVER.md
@@ -0,0 +1,78 @@
+---
+{
+ "title": "RECOVER",
+ "language": "en"
+}
+---
+
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+## RECOVER
+
+### Name
+
+REVOCER
+
+### Description
+
+This statement is used to restore a previously deleted database, table or
partition
+
+grammar:
+
+1) restore database
+
+```sql
+RECOVER DATABASE db_name;
+```
+
+ 1) restore table
+ 2) restore partition
+
+illustrate:
+
+- This operation can only restore meta information that was deleted in the
previous period. Default is 1 day. (Configurable through the
`catalog_trash_expire_second` parameter in fe.conf)
+- If a new meta information with the same name and type is created after the
meta information is deleted, the previously deleted meta information cannot be
recovered
+
+### Example
+
+1. Restore the database named example_db
+
+```sql
+RECOVER DATABASE example_db;
+```
+
+2. Restore the table named example_tbl
+
+```sql
+RECOVER TABLE example_db.example_tbl;
+```
+
+3. Restore the partition named p1 in table example_tbl
+
+```sql
+RECOVER PARTITION p1 FROM example_tbl;
+```
+
+### Keywords
+
+ RECOVER
+
+### Best Practice
+
diff --git
a/new-docs/en/sql-manual/sql-reference-v2/Data-Definition-Statements/Backup-and-Restore/RESTORE.md
b/new-docs/en/sql-manual/sql-reference-v2/Data-Definition-Statements/Backup-and-Restore/RESTORE.md
index 9ff29b3f98..cbbafd6cdf 100644
---
a/new-docs/en/sql-manual/sql-reference-v2/Data-Definition-Statements/Backup-and-Restore/RESTORE.md
+++
b/new-docs/en/sql-manual/sql-reference-v2/Data-Definition-Statements/Backup-and-Restore/RESTORE.md
@@ -26,13 +26,97 @@ under the License.
## RESTORE
+### Name
+
+RESTORE
+
### Description
+This statement is used to restore the data backed up by the BACKUP command to
the specified database. This command is an asynchronous operation. After the
submission is successful, you need to check the progress through the SHOW
RESTORE command. Restoring tables of type OLAP is only supported.
+
+grammar:
+
+```sql
+RESTORE SNAPSHOT [db_name].{snapshot_name}
+FROM `repository_name`
+[ON|EXCLUDE] (
+ `table_name` [PARTITION (`p1`, ...)] [AS `tbl_alias`],
+ ...
+)
+PROPERTIES ("key"="value", ...);
+```
+
+illustrate:
+
+- There can only be one executing BACKUP or RESTORE task under the same
database.
+- The tables and partitions that need to be restored are identified in the ON
clause. If no partition is specified, all partitions of the table are restored
by default. The specified table and partition must already exist in the
warehouse backup.
+- Tables and partitions that do not require recovery are identified in the
EXCLUDE clause. All partitions of all other tables in the warehouse except the
specified table or partition will be restored.
+- The table name backed up in the warehouse can be restored to a new table
through the AS statement. But the new table name cannot already exist in the
database. The partition name cannot be modified.
+- You can restore the backed up tables in the warehouse to replace the
existing tables of the same name in the database, but you must ensure that the
table structures of the two tables are exactly the same. The table structure
includes: table name, column, partition, Rollup, etc.
+- You can specify some partitions of the recovery table, and the system will
check whether the partition Range or List can match.
+- PROPERTIES currently supports the following properties:
+ - "backup_timestamp" = "2018-05-04-16-45-08": Specifies which time version
of the corresponding backup to restore, required. This information can be
obtained with the `SHOW SNAPSHOT ON repo;` statement.
+ - "replication_num" = "3": Specifies the number of replicas for the restored
table or partition. Default is 3. If restoring an existing table or partition,
the number of replicas must be the same as the number of replicas of the
existing table or partition. At the same time, there must be enough hosts to
accommodate multiple replicas.
+ - "timeout" = "3600": The task timeout period, the default is one day. in
seconds.
+ - "meta_version" = 40: Use the specified meta_version to read the previously
backed up metadata. Note that this parameter is used as a temporary solution
and is only used to restore the data backed up by the old version of Doris. The
latest version of the backup data already contains the meta version, no need to
specify it.
+
### Example
+1. Restore the table backup_tbl in backup snapshot_1 from example_repo to
database example_db1, the time version is "2018-05-04-16-45-08". Revert to 1
copy:
+
+```sql
+RESTORE SNAPSHOT example_db1.`snapshot_1`
+FROM `example_repo`
+ON ( `backup_tbl` )
+PROPERTIES
+(
+ "backup_timestamp"="2018-05-04-16-45-08",
+ "replication_num" = "1"
+);
+```
+
+2. Restore partitions p1, p2 of table backup_tbl in backup snapshot_2 from
example_repo, and table backup_tbl2 to database example_db1, rename it to
new_tbl, and the time version is "2018-05-04-17-11-01". The default reverts to
3 replicas:
+
+```sql
+RESTORE SNAPSHOT example_db1.`snapshot_2`
+FROM `example_repo`
+ON
+(
+ `backup_tbl` PARTITION (`p1`, `p2`),
+ `backup_tbl2` AS `new_tbl`
+)
+PROPERTIES
+(
+ "backup_timestamp"="2018-05-04-17-11-01"
+);
+```
+
+3. Restore all tables except for table backup_tbl in backup snapshot_3 from
example_repo to database example_db1, the time version is "2018-05-04-18-12-18".
+
+```sql
+RESTORE SNAPSHOT example_db1.`snapshot_3`
+FROM `example_repo`
+EXCLUDE ( `backup_tbl` )
+PROPERTIES
+(
+ "backup_timestamp"="2018-05-04-18-12-18"
+);
+```
+
### Keywords
- RESTORE
+```
+RESTORE
+```
### Best Practice
+1. There can only be one ongoing recovery operation under the same database.
+
+2. The table backed up in the warehouse can be restored and replaced with the
existing table of the same name in the database, but the table structure of the
two tables must be completely consistent. The table structure includes: table
name, columns, partitions, materialized views, and so on.
+
+3. When specifying a partial partition of the recovery table, the system will
check whether the partition range can match.
+
+4. Efficiency of recovery operations:
+
+ In the case of the same cluster size, the time-consuming of the restore
operation is basically the same as the time-consuming of the backup operation.
If you want to speed up the recovery operation, you can first restore only one
copy by setting the `replication_num` parameter, and then adjust the number of
copies by [ALTER TABLE
PROPERTY](../../Data-Definition-Statements/Alter/ALTER-TABLE-PROPERTY.html),
complete the copy.
diff --git
a/new-docs/zh-CN/sql-manual/sql-reference-v2/Data-Definition-Statements/Alter/ALTER-DATABASE.md
b/new-docs/zh-CN/sql-manual/sql-reference-v2/Data-Definition-Statements/Alter/ALTER-DATABASE.md
index 6a96c5914d..0555a45024 100644
---
a/new-docs/zh-CN/sql-manual/sql-reference-v2/Data-Definition-Statements/Alter/ALTER-DATABASE.md
+++
b/new-docs/zh-CN/sql-manual/sql-reference-v2/Data-Definition-Statements/Alter/ALTER-DATABASE.md
@@ -26,13 +26,66 @@ under the License.
## ALTER-DATABASE
+### Name
+
+ALTER DATABASE
+
### Description
+该语句用于设置指定数据库的属性。(仅管理员使用)
+
+1) 设置数据库数据量配额,单位为B/K/KB/M/MB/G/GB/T/TB/P/PB
+
+```sql
+ALTER DATABASE db_name SET DATA QUOTA quota;
+```
+
+2) 重命名数据库
+
+```sql
+ALTER DATABASE db_name RENAME new_db_name;
+```
+
+3) 设置数据库的副本数量配额
+
+```sql
+ALTER DATABASE db_name SET REPLICA QUOTA quota;
+```
+
+说明:
+ 重命名数据库后,如需要,请使用 REVOKE 和 GRANT 命令修改相应的用户权限。
+ 数据库的默认数据量配额为1024GB,默认副本数量配额为1073741824。
+
### Example
+1. 设置指定数据库数据量配额
+
+```sql
+ALTER DATABASE example_db SET DATA QUOTA 10995116277760;
+上述单位为字节,等价于
+ALTER DATABASE example_db SET DATA QUOTA 10T;
+
+ALTER DATABASE example_db SET DATA QUOTA 100G;
+
+ALTER DATABASE example_db SET DATA QUOTA 200M;
+```
+
+2. 将数据库 example_db 重命名为 example_db2
+
+```sql
+ALTER DATABASE example_db RENAME example_db2;
+```
+
+3. 设定指定数据库副本数量配额
+
+```sql
+ALTER DATABASE example_db SET REPLICA QUOTA 102400;
+```
+
### Keywords
- ALTER, DATABASE
+```text
+ALTER,DATABASE,RENAME
+```
### Best Practice
-
diff --git
a/new-docs/zh-CN/sql-manual/sql-reference-v2/Data-Definition-Statements/Alter/ALTER-TABLE-BITMAP.md
b/new-docs/zh-CN/sql-manual/sql-reference-v2/Data-Definition-Statements/Alter/ALTER-TABLE-BITMAP.md
new file mode 100644
index 0000000000..3c29bc9348
--- /dev/null
+++
b/new-docs/zh-CN/sql-manual/sql-reference-v2/Data-Definition-Statements/Alter/ALTER-TABLE-BITMAP.md
@@ -0,0 +1,87 @@
+---
+{
+ "title": "ALTER-TABLE-BITMAP",
+ "language": "zh-CN"
+}
+---
+
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+## ALTER-TABLE-BITMAP
+
+### Name
+
+ALTER TABLE BITMAP
+
+### Description
+
+该语句用于对已有 table 进行 bitmap index 操作。
+
+语法:
+
+```sql
+ALTER TABLE [database.]table alter_clause;
+```
+
+bitmap index 的 alter_clause 支持如下几种修改方式
+
+1. 创建bitmap 索引
+
+语法:
+
+```sql
+ADD INDEX [IF NOT EXISTS] index_name (column [, ...],) [USING BITMAP] [COMMENT
'balabala'];
+```
+
+注意:
+
+- 目前仅支持bitmap 索引
+- BITMAP 索引仅在单列上创建
+
+2. 删除索引
+
+语法:
+
+```sql
+DROP INDEX [IF EXISTS] index_name;
+```
+
+### Example
+
+1. 在table1 上为siteid 创建bitmap 索引
+
+```sql
+ALTER TABLE table1 ADD INDEX [IF NOT EXISTS] index_name (siteid) [USING
BITMAP] COMMENT 'balabala';
+```
+
+2. 删除table1 上的siteid列的bitmap 索引
+
+```sql
+ALTER TABLE table1 DROP INDEX [IF EXISTS] index_name;
+```
+
+### Keywords
+
+```text
+ALTER, TABLE, BITMAP
+```
+
+### Best Practice
+
diff --git
a/new-docs/zh-CN/sql-manual/sql-reference-v2/Data-Definition-Statements/Alter/ALTER-TABLE-COLUMN.md
b/new-docs/zh-CN/sql-manual/sql-reference-v2/Data-Definition-Statements/Alter/ALTER-TABLE-COLUMN.md
index a4aaa9eabb..12c8414614 100644
---
a/new-docs/zh-CN/sql-manual/sql-reference-v2/Data-Definition-Statements/Alter/ALTER-TABLE-COLUMN.md
+++
b/new-docs/zh-CN/sql-manual/sql-reference-v2/Data-Definition-Statements/Alter/ALTER-TABLE-COLUMN.md
@@ -26,13 +26,199 @@ under the License.
## ALTER-TABLE-COLUMN
+### Name
+
+ALTER TABLE COLUMN
+
### Description
+该语句用于对已有 table 进行 Schema change 操作。schema change 是异步的,任务提交成功则返回,之后可使用[SHOW
ALTER](../../Show-Statements/SHOW-ALTER.html) 命令查看进度。
+
+语法:
+
+```sql
+ALTER TABLE [database.]table alter_clause;
+```
+
+schema change 的 alter_clause 支持如下几种修改方式:
+
+1. 向指定 index 的指定位置添加一列
+
+语法:
+
+```sql
+ADD COLUMN column_name column_type [KEY | agg_type] [DEFAULT "default_value"]
+[AFTER column_name|FIRST]
+[TO rollup_index_name]
+[PROPERTIES ("key"="value", ...)]
+```
+
+ 注意:
+
+- 聚合模型如果增加 value 列,需要指定 agg_type
+- 非聚合模型(如 DUPLICATE KEY)如果增加key列,需要指定KEY关键字
+- 不能在 rollup index 中增加 base index 中已经存在的列(如有需要,可以重新创建一个 rollup index)
+
+2. 向指定 index 添加多列
+
+语法:
+
+```sql
+ADD COLUMN (column_name1 column_type [KEY | agg_type] DEFAULT "default_value",
...)
+[TO rollup_index_name]
+[PROPERTIES ("key"="value", ...)]
+```
+
+注意:
+
+- 聚合模型如果增加 value 列,需要指定agg_type
+- 聚合模型如果增加key列,需要指定KEY关键字
+- 不能在 rollup index 中增加 base index 中已经存在的列(如有需要,可以重新创建一个 rollup index)
+
+3. 从指定 index 中删除一列
+
+语法:
+
+```sql
+DROP COLUMN column_name
+[FROM rollup_index_name]
+```
+
+注意:
+
+- 不能删除分区列
+- 如果是从 base index 中删除列,则如果 rollup index 中包含该列,也会被删除
+
+4. 修改指定 index 的列类型以及列位置
+
+ 语法:
+
+```sql
+MODIFY COLUMN column_name column_type [KEY | agg_type] [NULL | NOT NULL]
[DEFAULT "default_value"]
+[AFTER column_name|FIRST]
+[FROM rollup_index_name]
+[PROPERTIES ("key"="value", ...)]
+```
+
+注意:
+
+- 聚合模型如果修改 value 列,需要指定 agg_type
+- 非聚合类型如果修改key列,需要指定KEY关键字
+- 只能修改列的类型,列的其他属性维持原样(即其他属性需在语句中按照原属性显式的写出,参见 example 8)
+- 分区列和分桶列不能做任何修改
+- 目前支持以下类型的转换(精度损失由用户保证)
+ - TINYINT/SMALLINT/INT/BIGINT/LARGEINT/FLOAT/DOUBLE 类型向范围更大的数字类型转换
+ - TINTINT/SMALLINT/INT/BIGINT/LARGEINT/FLOAT/DOUBLE/DECIMAL 转换成 VARCHAR
+ - VARCHAR 支持修改最大长度
+ - VARCHAR/CHAR 转换成 TINTINT/SMALLINT/INT/BIGINT/LARGEINT/FLOAT/DOUBLE
+ - VARCHAR/CHAR 转换成 DATE (目前支持"%Y-%m-%d", "%y-%m-%d", "%Y%m%d", "%y%m%d",
"%Y/%m/%d, "%y/%m/%d"六种格式化格式)
+ - DATETIME 转换成 DATE(仅保留年-月-日信息, 例如: `2019-12-09 21:47:05` <--> `2019-12-09`)
+ - DATE 转换成 DATETIME(时分秒自动补零, 例如: `2019-12-09` <--> `2019-12-09 00:00:00`)
+ - FLOAT 转换成 DOUBLE
+ - INT 转换成 DATE (如果INT类型数据不合法则转换失败,原始数据不变)
+
+5. 对指定 index 的列进行重新排序
+
+语法:
+
+```sql
+ORDER BY (column_name1, column_name2, ...)
+[FROM rollup_index_name]
+[PROPERTIES ("key"="value", ...)]
+```
+
+注意:
+
+- index 中的所有列都要写出来
+- value 列在 key 列之后
+
### Example
+1. 向 example_rollup_index 的 col1 后添加一个key列 new_col(非聚合模型)
+
+```sql
+ALTER TABLE example_db.my_table
+ADD COLUMN new_col INT KEY DEFAULT "0" AFTER col1
+TO example_rollup_index;
+```
+
+2. 向example_rollup_index的col1后添加一个value列new_col(非聚合模型)
+
+```sql
+ALTER TABLE example_db.my_table
+ADD COLUMN new_col INT DEFAULT "0" AFTER col1
+TO example_rollup_index;
+```
+
+3. 向example_rollup_index的col1后添加一个key列new_col(聚合模型)
+
+```sql
+ALTER TABLE example_db.my_table
+ADD COLUMN new_col INT DEFAULT "0" AFTER col1
+TO example_rollup_index;
+```
+
+4. 向example_rollup_index的col1后添加一个value列new_col SUM聚合类型(聚合模型)
+
+```sql
+ALTER TABLE example_db.my_table
+ADD COLUMN new_col INT SUM DEFAULT "0" AFTER col1
+TO example_rollup_index;
+```
+
+5. 向 example_rollup_index 添加多列(聚合模型)
+
+```sql
+ALTER TABLE example_db.my_table
+ADD COLUMN (col1 INT DEFAULT "1", col2 FLOAT SUM DEFAULT "2.3")
+TO example_rollup_index;
+```
+
+6. 从 example_rollup_index 删除一列
+
+```sql
+ALTER TABLE example_db.my_table
+DROP COLUMN col2
+FROM example_rollup_index;
+```
+
+7. 修改 base index 的 key 列 col1 的类型为 BIGINT,并移动到 col2 列后面。
+
+```sql
+ALTER TABLE example_db.my_table
+MODIFY COLUMN col1 BIGINT KEY DEFAULT "1" AFTER col2;
+```
+
+注意:无论是修改 key 列还是 value 列都需要声明完整的 column 信息
+
+8. 修改 base index 的 val1 列最大长度。原 val1 为 (val1 VARCHAR(32) REPLACE DEFAULT "abc")
+
+```sql
+ALTER TABLE example_db.my_table
+MODIFY COLUMN val1 VARCHAR(64) REPLACE DEFAULT "abc";
+```
+
+9. 重新排序 example_rollup_index 中的列(设原列顺序为:k1,k2,k3,v1,v2)
+
+```sql
+ALTER TABLE example_db.my_table
+ORDER BY (k3,k1,k2,v2,v1)
+FROM example_rollup_index;
+```
+
+10. 同时执行两种操作
+
+```sql
+ALTER TABLE example_db.my_table
+ADD COLUMN v2 INT MAX DEFAULT "0" AFTER k2 TO example_rollup_index,
+ORDER BY (k3,k1,k2,v2,v1) FROM example_rollup_index;
+```
+
### Keywords
- ALTER, TABLE, COLUMN
+```text
+ALTER, TABLE, COLUMN
+```
### Best Practice
diff --git
a/new-docs/zh-CN/sql-manual/sql-reference-v2/Data-Definition-Statements/Alter/ALTER-TABLE-PARTITION.md
b/new-docs/zh-CN/sql-manual/sql-reference-v2/Data-Definition-Statements/Alter/ALTER-TABLE-PARTITION.md
index 67b9408154..2b4e5c423d 100644
---
a/new-docs/zh-CN/sql-manual/sql-reference-v2/Data-Definition-Statements/Alter/ALTER-TABLE-PARTITION.md
+++
b/new-docs/zh-CN/sql-manual/sql-reference-v2/Data-Definition-Statements/Alter/ALTER-TABLE-PARTITION.md
@@ -26,13 +26,141 @@ under the License.
## ALTER-TABLE-PARTITION
+### Name
+
+ALTER TABLE PARTITION
+
### Description
+该语句用于对已有 table 的 partition 进行修改操作。
+
+这个操作是同步的,命令返回表示执行完毕。
+
+语法:
+
+```sql
+ALTER TABLE [database.]table alter_clause;
+```
+
+partition 的 alter_clause 支持如下几种修改方式
+
+1. 增加分区
+
+语法:
+
+```sql
+ADD PARTITION [IF NOT EXISTS] partition_name
+partition_desc ["key"="value"]
+[DISTRIBUTED BY HASH (k1[,k2 ...]) [BUCKETS num]]
+```
+
+注意:
+
+- partition_desc 支持以下两种写法
+ - VALUES LESS THAN [MAXVALUE|("value1", ...)]
+ - VALUES [("value1", ...), ("value1", ...))
+- 分区为左闭右开区间,如果用户仅指定右边界,系统会自动确定左边界
+- 如果没有指定分桶方式,则自动使用建表使用的分桶方式
+- 如指定分桶方式,只能修改分桶数,不可修改分桶方式或分桶列
+- ["key"="value"] 部分可以设置分区的一些属性,具体说明见 [CREATE
TABLE](./sql-manual/sql-reference-v2/Data-Definition-Statements/Create/CREATE-TABLE.html)
+- 如果建表时用户未显式创建Partition,则不支持通过ALTER的方式增加分区
+
+2. 删除分区
+
+语法:
+
+```sql
+DROP PARTITION [IF EXISTS] partition_name [FORCE]
+```
+
+ 注意:
+
+- 使用分区方式的表至少要保留一个分区。
+- 执行 DROP PARTITION 一段时间内,可以通过 RECOVER 语句恢复被删除的分区。详见 SQL手册-数据库管理-RECOVER 语句
+- 如果执行 DROP PARTITION FORCE,则系统不会检查该分区是否存在未完成的事务,分区将直接被删除并且不能被恢复,一般不建议执行此操作
+
+3. 修改分区属性
+
+ 语法:
+
+```sql
+MODIFY PARTITION p1|(p1[, p2, ...]) SET ("key" = "value", ...)
+```
+
+说明:
+
+- 当前支持修改分区的下列属性:
+ - storage_medium
+ - storage_cooldown_time
+ - replication_num
+ - in_memory
+- 对于单分区表,partition_name 同表名。
+
### Example
+1. 增加分区, 现有分区 [MIN, 2013-01-01),增加分区 [2013-01-01, 2014-01-01),使用默认分桶方式
+
+```sql
+ALTER TABLE example_db.my_table
+ADD PARTITION p1 VALUES LESS THAN ("2014-01-01");
+```
+
+2. 增加分区,使用新的分桶数
+
+```sql
+ALTER TABLE example_db.my_table
+ADD PARTITION p1 VALUES LESS THAN ("2015-01-01")
+DISTRIBUTED BY HASH(k1) BUCKETS 20;
+```
+
+3. 增加分区,使用新的副本数
+
+```sql
+ALTER TABLE example_db.my_table
+ADD PARTITION p1 VALUES LESS THAN ("2015-01-01")
+("replication_num"="1");
+```
+
+4. 修改分区副本数
+
+```sql
+ALTER TABLE example_db.my_table
+MODIFY PARTITION p1 SET("replication_num"="1");
+```
+
+5. 批量修改指定分区
+
+```sql
+ALTER TABLE example_db.my_table
+MODIFY PARTITION (p1, p2, p4) SET("in_memory"="true");
+```
+
+6. 批量修改所有分区
+
+```sql
+ALTER TABLE example_db.my_table
+MODIFY PARTITION (*) SET("storage_medium"="HDD");
+```
+
+7. 删除分区
+
+```sql
+ALTER TABLE example_db.my_table
+DROP PARTITION p1;
+```
+
+8. 增加一个指定上下界的分区
+
+```sql
+ALTER TABLE example_db.my_table
+ADD PARTITION p1 VALUES [("2014-01-01"), ("2014-02-01"));
+```
+
### Keywords
- ALTER, TABLE, PARTITION
+```text
+ALTER, TABLE, PARTITION
+```
### Best Practice
diff --git
a/new-docs/zh-CN/sql-manual/sql-reference-v2/Data-Definition-Statements/Alter/ALTER-TABLE-PROPERTY.md
b/new-docs/zh-CN/sql-manual/sql-reference-v2/Data-Definition-Statements/Alter/ALTER-TABLE-PROPERTY.md
index c9ed837e2f..756b2b7420 100644
---
a/new-docs/zh-CN/sql-manual/sql-reference-v2/Data-Definition-Statements/Alter/ALTER-TABLE-PROPERTY.md
+++
b/new-docs/zh-CN/sql-manual/sql-reference-v2/Data-Definition-Statements/Alter/ALTER-TABLE-PROPERTY.md
@@ -26,13 +26,191 @@ under the License.
## ALTER-TABLE-PROPERTY
+### Name
+
+ALTER TABLE PROPERTY
+
### Description
+该语句用于对已有 table 的 property 进行修改操作。这个操作是同步的,命令返回表示执行完毕。
+
+语法:
+
+```sql
+ALTER TABLE [database.]table alter_clause;
+```
+
+property 的 alter_clause 支持如下几种修改方式
+
+1. 修改表的 bloom filter 列
+
+```sql
+ALTER TABLE example_db.my_table SET ("bloom_filter_columns"="k1,k2,k3");
+```
+
+也可以合并到上面的 schema change 操作中(注意多子句的语法有少许区别)
+
+```sql
+ALTER TABLE example_db.my_table
+DROP COLUMN col2
+PROPERTIES ("bloom_filter_columns"="k1,k2,k3");
+```
+
+2. 修改表的Colocate 属性
+
+```sql
+ALTER TABLE example_db.my_table set ("colocate_with" = "t1");
+```
+
+3. 将表的分桶方式由 Hash Distribution 改为 Random Distribution
+
+```sql
+ALTER TABLE example_db.my_table set ("distribution_type" = "random");
+```
+
+4. 修改表的动态分区属性(支持未添加动态分区属性的表添加动态分区属性)
+
+```sql
+ALTER TABLE example_db.my_table set ("dynamic_partition.enable" = "false");
+```
+
+如果需要在未添加动态分区属性的表中添加动态分区属性,则需要指定所有的动态分区属性
+ (注:非分区表不支持添加动态分区属性)
+
+```sql
+ALTER TABLE example_db.my_table set ("dynamic_partition.enable" = "true",
"dynamic_partition.time_unit" = "DAY", "dynamic_partition.end" = "3",
"dynamic_partition.prefix" = "p", "dynamic_partition.buckets" = "32");
+```
+
+5. 修改表的 in_memory 属性
+
+```sql
+ALTER TABLE example_db.my_table set ("in_memory" = "true");
+```
+
+6. 启用 批量删除功能
+
+```sql
+ALTER TABLE example_db.my_table ENABLE FEATURE "BATCH_DELETE";
+```
+
+7. 启用按照sequence column的值来保证导入顺序的功能
+
+```sql
+ALTER TABLE example_db.my_table ENABLE FEATURE "SEQUENCE_LOAD" WITH PROPERTIES
("function_column.sequence_type" = "Date");
+```
+
+8. 将表的默认分桶数改为50
+
+```sql
+ALTER TABLE example_db.my_table MODIFY DISTRIBUTION DISTRIBUTED BY HASH(k1)
BUCKETS 50;
+```
+
+9. 修改表注释
+
+```sql
+ALTER TABLE example_db.my_table MODIFY COMMENT "new comment";
+```
+
+10. 修改列注释
+
+```sql
+ALTER TABLE example_db.my_table MODIFY COLUMN k1 COMMENT "k1", MODIFY COLUMN
k2 COMMENT "k2";
+```
+
+11. 修改引擎类型
+
+```sql
+ALTER TABLE example_db.mysql_table MODIFY ENGINE TO odbc PROPERTIES("driver" =
"MySQL");
+```
+
### Example
+1. 修改表的 bloom filter 列
+
+```sql
+ALTER TABLE example_db.my_table SET ("bloom_filter_columns"="k1,k2,k3");
+```
+
+也可以合并到上面的 schema change 操作中(注意多子句的语法有少许区别)
+
+```sql
+ALTER TABLE example_db.my_table
+DROP COLUMN col2
+PROPERTIES ("bloom_filter_columns"="k1,k2,k3");
+```
+
+2. 修改表的Colocate 属性
+
+```sql
+ALTER TABLE example_db.my_table set ("colocate_with" = "t1");
+```
+
+3. 将表的分桶方式由 Hash Distribution 改为 Random Distribution
+
+```sql
+ALTER TABLE example_db.my_table set ("distribution_type" = "random");
+```
+
+4. 修改表的动态分区属性(支持未添加动态分区属性的表添加动态分区属性)
+
+```sql
+ALTER TABLE example_db.my_table set ("dynamic_partition.enable" = "false");
+```
+
+如果需要在未添加动态分区属性的表中添加动态分区属性,则需要指定所有的动态分区属性
+ (注:非分区表不支持添加动态分区属性)
+
+```sql
+ALTER TABLE example_db.my_table set ("dynamic_partition.enable" = "true",
"dynamic_partition.time_unit" = "DAY", "dynamic_partition.end" = "3",
"dynamic_partition.prefix" = "p", "dynamic_partition.buckets" = "32");
+```
+
+5. 修改表的 in_memory 属性
+
+```sql
+ALTER TABLE example_db.my_table set ("in_memory" = "true");
+```
+
+6. 启用 批量删除功能
+
+```sql
+ALTER TABLE example_db.my_table ENABLE FEATURE "BATCH_DELETE";
+```
+
+7. 启用按照sequence column的值来保证导入顺序的功能
+
+```sql
+ALTER TABLE example_db.my_table ENABLE FEATURE "SEQUENCE_LOAD" WITH PROPERTIES
("function_column.sequence_type" = "Date");
+```
+
+8. 将表的默认分桶数改为50
+
+```sql
+ALTER TABLE example_db.my_table MODIFY DISTRIBUTION DISTRIBUTED BY HASH(k1)
BUCKETS 50;
+```
+
+9. 修改表注释
+
+```sql
+ALTER TABLE example_db.my_table MODIFY COMMENT "new comment";
+```
+
+10. 修改列注释
+
+```sql
+ALTER TABLE example_db.my_table MODIFY COLUMN k1 COMMENT "k1", MODIFY COLUMN
k2 COMMENT "k2";
+```
+
+11. 修改引擎类型
+
+```sql
+ALTER TABLE example_db.mysql_table MODIFY ENGINE TO odbc PROPERTIES("driver" =
"MySQL");
+```
+
### Keywords
- ALTER, TABLE, PROPERTY
+```text
+ALTER, TABLE, PROPERTY
+```
### Best Practice
diff --git
a/new-docs/zh-CN/sql-manual/sql-reference-v2/Data-Definition-Statements/Alter/ALTER-TABLE-RENAME.md
b/new-docs/zh-CN/sql-manual/sql-reference-v2/Data-Definition-Statements/Alter/ALTER-TABLE-RENAME.md
index 9a02821546..c4fe95b197 100644
---
a/new-docs/zh-CN/sql-manual/sql-reference-v2/Data-Definition-Statements/Alter/ALTER-TABLE-RENAME.md
+++
b/new-docs/zh-CN/sql-manual/sql-reference-v2/Data-Definition-Statements/Alter/ALTER-TABLE-RENAME.md
@@ -26,13 +26,71 @@ under the License.
## ALTER-TABLE-RENAME
+### Name
+
+ALTER TABLE RENAME
+
### Description
+该语句用于对已有 table 属性的某些名称进行重命名操作。这个操作是同步的,命令返回表示执行完毕。
+
+语法:
+
+```sql
+ALTER TABLE [database.]table alter_clause;
+```
+
+rename 的 alter_clause 支持对以下名称进行修改
+
+1. 修改表名
+
+语法:
+
+```sql
+RENAME new_table_name;
+```
+
+2. 修改 rollup index 名称
+
+ 语法:
+
+```sql
+RENAME ROLLUP old_rollup_name new_rollup_name;
+```
+
+3. 修改 partition 名称
+
+语法:
+
+```sql
+RENAME PARTITION old_partition_name new_partition_name;
+```
+
### Example
+1. 将名为 table1 的表修改为 table2
+
+```sql
+ALTER TABLE table1 RENAME table2;
+```
+
+2. 将表 example_table 中名为 rollup1 的 rollup index 修改为 rollup2
+
+```sql
+ALTER TABLE example_table RENAME ROLLUP rollup1 rollup2;
+```
+
+3. 将表 example_table 中名为 p1 的 partition 修改为 p2
+
+```sql
+ALTER TABLE example_table RENAME PARTITION p1 p2;
+```
+
### Keywords
- ALTER, TABLE, RENAME
+```text
+ALTER, TABLE, RENAME
+```
### Best Practice
diff --git
a/new-docs/zh-CN/sql-manual/sql-reference-v2/Data-Definition-Statements/Alter/ALTER-TABLE-REPLACE.md
b/new-docs/zh-CN/sql-manual/sql-reference-v2/Data-Definition-Statements/Alter/ALTER-TABLE-REPLACE.md
index 1db4b7c4a1..40b4ad65fe 100644
---
a/new-docs/zh-CN/sql-manual/sql-reference-v2/Data-Definition-Statements/Alter/ALTER-TABLE-REPLACE.md
+++
b/new-docs/zh-CN/sql-manual/sql-reference-v2/Data-Definition-Statements/Alter/ALTER-TABLE-REPLACE.md
@@ -26,13 +26,32 @@ under the License.
## ALTER-TABLE-REPLACE
+### Name
+
+ALTER TABLE REPLACE
+
### Description
+该语句用于对已有 table 的 Schema 的进行属性的修改操作。语法基本类似于 [ALTER TABLE
CULUMN](ALTER-TABLE-COLUMN.html)。
+
+```sql
+ALTER TABLE [database.]table MODIFY NEW_COLUMN_INFO REPLACE OLD_COLUMN_INFO ;
+```
+
### Example
+1. 修改 base index 的 val1 列最大长度。原 val1 为 (val1 VARCHAR(32) REPLACE DEFAULT "abc")
+
+```sql
+ALTER TABLE example_db.my_table
+MODIFY COLUMN val1 VARCHAR(64) REPLACE DEFAULT "abc";
+```
+
### Keywords
- ALTER, TABLE, REPLACE
+```text
+ALTER, TABLE, REPLACE
+```
### Best Practice
diff --git
a/new-docs/zh-CN/sql-manual/sql-reference-v2/Data-Definition-Statements/Alter/ALTER-TABLE-ROLLUP.md
b/new-docs/zh-CN/sql-manual/sql-reference-v2/Data-Definition-Statements/Alter/ALTER-TABLE-ROLLUP.md
index 9a88a09ab9..b5c520a072 100644
---
a/new-docs/zh-CN/sql-manual/sql-reference-v2/Data-Definition-Statements/Alter/ALTER-TABLE-ROLLUP.md
+++
b/new-docs/zh-CN/sql-manual/sql-reference-v2/Data-Definition-Statements/Alter/ALTER-TABLE-ROLLUP.md
@@ -26,13 +26,105 @@ under the License.
## ALTER-TABLE-ROLLUP
+### Name
+
+ALTER TABLE ROLLUP
+
### Description
+该语句用于对已有 table 进行 rollup 进行修改操作。rollup 是异步操作,任务提交成功则返回,之后可使用[SHOW
ALTER](../../Show-Statements/SHOW-ALTER.html) 命令查看进度。
+
+语法:
+
+```sql
+ALTER TABLE [database.]table alter_clause;
+```
+
+rollup 的 alter_clause 支持如下几种创建方式
+
+1. 创建 rollup index
+
+语法:
+
+```sql
+ADD ROLLUP rollup_name (column_name1, column_name2, ...)
+[FROM from_index_name]
+[PROPERTIES ("key"="value", ...)]
+```
+
+2. 批量创建 rollup index
+
+语法:
+
+```sql
+ADD ROLLUP [rollup_name (column_name1, column_name2, ...)
+ [FROM from_index_name]
+ [PROPERTIES ("key"="value", ...)],...]
+```
+
+注意:
+
+- 如果没有指定 from_index_name,则默认从 base index 创建
+- rollup 表中的列必须是 from_index 中已有的列
+- 在 properties 中,可以指定存储格式。具体请参阅 [CREATE
TABLE](../Create/CREATE-TABLE.html#create-table)
+
+3. 删除 rollup index
+
+ 语法:
+
+```sql
+DROP ROLLUP rollup_name [PROPERTIES ("key"="value", ...)]
+```
+
+4. 批量删除 rollup index
+
+语法:
+
+```sql
+DROP ROLLUP [rollup_name [PROPERTIES ("key"="value", ...)],...]
+```
+
+注意:
+
+- 不能删除 base index
+
### Example
+1. 创建 index: example_rollup_index,基于 base index(k1,k2,k3,v1,v2)。列式存储。
+
+```sql
+ALTER TABLE example_db.my_table
+ADD ROLLUP example_rollup_index(k1, k3, v1, v2);
+```
+
+2. 创建 index: example_rollup_index2,基于 example_rollup_index(k1,k3,v1,v2)
+
+```sql
+ALTER TABLE example_db.my_table
+ADD ROLLUP example_rollup_index2 (k1, v1)
+FROM example_rollup_index;
+```
+
+3. 创建 index: example_rollup_index3, 基于 base index (k1,k2,k3,v1), 自定义 rollup
超时时间一小时。
+
+```sql
+ALTER TABLE example_db.my_table
+ADD ROLLUP example_rollup_index(k1, k3, v1)
+PROPERTIES("timeout" = "3600");
+```
+
+4. 删除 index: example_rollup_index2
+
+```sql
+ALTER TABLE example_db.my_table
+DROP ROLLUP example_rollup_index2;
+```
+
### Keywords
- ALTER, TABLE, ROLLUP
+```text
+ALTER, TABLE, ROLLUP
+```
### Best Practice
diff --git
a/new-docs/zh-CN/sql-manual/sql-reference-v2/Data-Definition-Statements/Alter/ALTER-VIEW.md
b/new-docs/zh-CN/sql-manual/sql-reference-v2/Data-Definition-Statements/Alter/ALTER-VIEW.md
index 5f9c575d85..3d07dcf669 100644
---
a/new-docs/zh-CN/sql-manual/sql-reference-v2/Data-Definition-Statements/Alter/ALTER-VIEW.md
+++
b/new-docs/zh-CN/sql-manual/sql-reference-v2/Data-Definition-Statements/Alter/ALTER-VIEW.md
@@ -26,13 +26,48 @@ under the License.
## ALTER-VIEW
+### Name
+
+ALTER VIEW
+
### Description
+该语句用于修改一个view的定义
+
+语法:
+
+```sql
+ALTER VIEW
+[db_name.]view_name
+(column1[ COMMENT "col comment"][, column2, ...])
+AS query_stmt
+```
+
+说明:
+
+- 视图都是逻辑上的,其中的数据不会存储在物理介质上,在查询时视图将作为语句中的子查询,因此,修改视图的定义等价于修改query_stmt。
+- query_stmt 为任意支持的 SQL
+
### Example
+1、修改example_db上的视图example_view
+
+```sql
+ALTER VIEW example_db.example_view
+(
+ c1 COMMENT "column 1",
+ c2 COMMENT "column 2",
+ c3 COMMENT "column 3"
+)
+AS SELECT k1, k2, SUM(v1) FROM example_table
+GROUP BY k1, k2
+```
+
### Keywords
- ALTER, VIEW
+```text
+ALTER, VIEW
+```
### Best Practice
diff --git
a/new-docs/zh-CN/sql-manual/sql-reference-v2/Data-Definition-Statements/Alter/CANCEL-ALTER-TABLE.md
b/new-docs/zh-CN/sql-manual/sql-reference-v2/Data-Definition-Statements/Alter/CANCEL-ALTER-TABLE.md
index 7e1767e3bc..1521cca9cd 100644
---
a/new-docs/zh-CN/sql-manual/sql-reference-v2/Data-Definition-Statements/Alter/CANCEL-ALTER-TABLE.md
+++
b/new-docs/zh-CN/sql-manual/sql-reference-v2/Data-Definition-Statements/Alter/CANCEL-ALTER-TABLE.md
@@ -26,10 +26,82 @@ under the License.
## CANCEL-ALTER-TABLE
+### Name
+
+CANCEL ALTER TABLE
+
### Description
+该语句用于撤销一个 ALTER 操作。
+
+1. 撤销 ALTER TABLE COLUMN 操作
+
+语法:
+
+```sql
+CANCEL ALTER TABLE COLUMN
+FROM db_name.table_name
+```
+
+2. 撤销 ALTER TABLE ROLLUP 操作
+
+语法:
+
+```sql
+CANCEL ALTER TABLE ROLLUP
+FROM db_name.table_name
+```
+
+3. 根据job id批量撤销rollup操作
+
+语法:
+
+```sql
+CANCEL ALTER TABLE ROLLUP
+FROM db_name.table_name (jobid,...)
+```
+
+注意:
+
+- 该命令为异步操作,具体是否执行成功需要使用`show alter table rollup`查看任务状态确认
+
+4. 撤销 ALTER CLUSTER 操作
+
+语法:
+
+```
+(待实现...)
+```
+
### Example
+1. 撤销针对 my_table 的 ALTER COLUMN 操作。
+
+ [CANCEL ALTER TABLE COLUMN]
+
+```sql
+CANCEL ALTER TABLE COLUMN
+FROM example_db.my_table;
+```
+
+1. 撤销 my_table 下的 ADD ROLLUP 操作。
+
+ [CANCEL ALTER TABLE ROLLUP]
+
+```sql
+CANCEL ALTER TABLE ROLLUP
+FROM example_db.my_table;
+```
+
+1. 根据job id撤销 my_table 下的 ADD ROLLUP 操作。
+
+ [CANCEL ALTER TABLE ROLLUP]
+
+```sql
+CANCEL ALTER TABLE ROLLUP
+FROM example_db.my_table (12801,12802);
+```
+
### Keywords
CANCEL, ALTER, TABLE
diff --git
a/new-docs/zh-CN/sql-manual/sql-reference-v2/Data-Definition-Statements/Backup-and-Restore/BACKUP.md
b/new-docs/zh-CN/sql-manual/sql-reference-v2/Data-Definition-Statements/Backup-and-Restore/BACKUP.md
index bb60b2e67b..1115f534b7 100644
---
a/new-docs/zh-CN/sql-manual/sql-reference-v2/Data-Definition-Statements/Backup-and-Restore/BACKUP.md
+++
b/new-docs/zh-CN/sql-manual/sql-reference-v2/Data-Definition-Statements/Backup-and-Restore/BACKUP.md
@@ -26,13 +26,80 @@ under the License.
## BACKUP
+### Name
+
+BACKUP
+
### Description
+该语句用于备份指定数据库下的数据。该命令为异步操作。提交成功后,需通过 SHOW BACKUP 命令查看进度。仅支持备份 OLAP 类型的表。
+
+语法:
+
+```sql
+BACKUP SNAPSHOT [db_name].{snapshot_name}
+TO `repository_name`
+[ON|EXCLUDE] (
+ `table_name` [PARTITION (`p1`, ...)],
+ ...
+)
+PROPERTIES ("key"="value", ...);
+```
+
+说明:
+
+- 同一数据库下只能有一个正在执行的 BACKUP 或 RESTORE 任务。
+- ON 子句中标识需要备份的表和分区。如果不指定分区,则默认备份该表的所有分区
+- EXCLUDE 子句中标识不需要备份的表和分区。备份除了指定的表或分区之外这个数据库中所有表的所有分区数据。
+- PROPERTIES 目前支持以下属性:
+ - "type" = "full":表示这是一次全量更新(默认)
+ - "timeout" = "3600":任务超时时间,默认为一天。单位秒。
+
### Example
+1. 全量备份 example_db 下的表 example_tbl 到仓库 example_repo 中:
+
+```sql
+BACKUP SNAPSHOT example_db.snapshot_label1
+TO example_repo
+ON (example_tbl)
+PROPERTIES ("type" = "full");
+```
+
+2. 全量备份 example_db 下,表 example_tbl 的 p1, p2 分区,以及表 example_tbl2 到仓库
example_repo 中:
+
+```sql
+BACKUP SNAPSHOT example_db.snapshot_label2
+TO example_repo
+ON
+(
+ example_tbl PARTITION (p1,p2),
+ example_tbl2
+);
+```
+
+3. 全量备份 example_db 下除了表 example_tbl 的其他所有表到仓库 example_repo 中:
+
+```sql
+BACKUP SNAPSHOT example_db.snapshot_label3
+TO example_repo
+EXCLUDE (example_tbl);
+```
+
### Keywords
- BACKUP
+```text
+BACKUP
+```
### Best Practice
+1. 同一个数据库下只能进行一个备份操作。
+
+2. 备份操作会备份指定表或分区的基础表及
[物化视图](../../../../advanced/materialized-view.html),并且仅备份一副本。
+
+3. 备份操作的效率
+
+ 备份操作的效率取决于数据量、Compute Node 节点数量以及文件数量。备份数据分片所在的每个 Compute Node
都会参与备份操作的上传阶段。节点数量越多,上传的效率越高。
+
+ 文件数据量只涉及到的分片数,以及每个分片中文件的数量。如果分片非常多,或者分片内的小文件较多,都可能增加备份操作的时间。
diff --git
a/new-docs/zh-CN/sql-manual/sql-reference-v2/Data-Definition-Statements/Backup-and-Restore/CANCEL-BACKUP.md
b/new-docs/zh-CN/sql-manual/sql-reference-v2/Data-Definition-Statements/Backup-and-Restore/CANCEL-BACKUP.md
index 07e0b1c94d..2e5d7f5b95 100644
---
a/new-docs/zh-CN/sql-manual/sql-reference-v2/Data-Definition-Statements/Backup-and-Restore/CANCEL-BACKUP.md
+++
b/new-docs/zh-CN/sql-manual/sql-reference-v2/Data-Definition-Statements/Backup-and-Restore/CANCEL-BACKUP.md
@@ -26,10 +26,28 @@ under the License.
## CANCEL-BACKUP
+### Name
+
+CANCEL BACKUP
+
### Description
+该语句用于取消一个正在进行的 BACKUP 任务。
+
+语法:
+
+```sql
+CANCEL BACKUP FROM db_name;
+```
+
### Example
+1. 取消 example_db 下的 BACKUP 任务。
+
+```sql
+CANCEL BACKUP FROM example_db;
+```
+
### Keywords
CANCEL, BACKUP
diff --git
a/new-docs/zh-CN/sql-manual/sql-reference-v2/Data-Definition-Statements/Backup-and-Restore/CANCEL-RESTORE.md
b/new-docs/zh-CN/sql-manual/sql-reference-v2/Data-Definition-Statements/Backup-and-Restore/CANCEL-RESTORE.md
index 37cb5c4585..5a39921be3 100644
---
a/new-docs/zh-CN/sql-manual/sql-reference-v2/Data-Definition-Statements/Backup-and-Restore/CANCEL-RESTORE.md
+++
b/new-docs/zh-CN/sql-manual/sql-reference-v2/Data-Definition-Statements/Backup-and-Restore/CANCEL-RESTORE.md
@@ -26,10 +26,32 @@ under the License.
## CANCEL-RESTORE
+### Name
+
+CANCEL RESTORE
+
### Description
+该语句用于取消一个正在进行的 RESTORE 任务。
+
+语法:
+
+```sql
+CANCEL RESTORE FROM db_name;
+```
+
+注意:
+
+- 当取消处于 COMMIT 或之后阶段的恢复左右时,可能导致被恢复的表无法访问。此时只能通过再次执行恢复作业进行数据恢复。
+
### Example
+1. 取消 example_db 下的 RESTORE 任务。
+
+```sql
+CANCEL RESTORE FROM example_db;
+```
+
### Keywords
CANCEL, RESTORE
diff --git
a/new-docs/zh-CN/sql-manual/sql-reference-v2/Data-Definition-Statements/Backup-and-Restore/CREATE-REPOSITORY.md
b/new-docs/zh-CN/sql-manual/sql-reference-v2/Data-Definition-Statements/Backup-and-Restore/CREATE-REPOSITORY.md
index e345171576..56e0366c78 100644
---
a/new-docs/zh-CN/sql-manual/sql-reference-v2/Data-Definition-Statements/Backup-and-Restore/CREATE-REPOSITORY.md
+++
b/new-docs/zh-CN/sql-manual/sql-reference-v2/Data-Definition-Statements/Backup-and-Restore/CREATE-REPOSITORY.md
@@ -26,13 +26,93 @@ under the License.
## CREATE-REPOSITORY
+### Name
+
+CREATE REPOSITORY
+
### Description
+该语句用于创建仓库。仓库用于属于备份或恢复。仅 root 或 superuser 用户可以创建仓库。
+
+语法:
+
+```sql
+CREATE [READ ONLY] REPOSITORY `repo_name`
+WITH [BROKER `broker_name`|S3]
+ON LOCATION `repo_location`
+PROPERTIES ("key"="value", ...);
+```
+
+说明:
+
+- 仓库的创建,依赖于已存在的 broker 或者直接通过AWS s3 协议访问云存储
+- 如果是只读仓库,则只能在仓库上进行恢复。如果不是,则可以进行备份和恢复操作。
+- 根据 broker 或者S3的不同类型,PROPERTIES 有所不同,具体见示例。
+
### Example
+1. 创建名为 bos_repo 的仓库,依赖 BOS broker "bos_broker",数据根目录为:bos://palo_backup
+
+```sql
+CREATE REPOSITORY `bos_repo`
+WITH BROKER `bos_broker`
+ON LOCATION "bos://palo_backup"
+PROPERTIES
+(
+ "bos_endpoint" = "http://gz.bcebos.com",
+ "bos_accesskey" = "bos_accesskey",
+ "bos_secret_accesskey"="bos_secret_accesskey"
+);
+```
+
+2. 创建和示例 1 相同的仓库,但属性为只读:
+
+```sql
+CREATE READ ONLY REPOSITORY `bos_repo`
+WITH BROKER `bos_broker`
+ON LOCATION "bos://palo_backup"
+PROPERTIES
+(
+ "bos_endpoint" = "http://gz.bcebos.com",
+ "bos_accesskey" = "bos_accesskey",
+ "bos_secret_accesskey"="bos_accesskey"
+);
+```
+
+3. 创建名为 hdfs_repo 的仓库,依赖 Baidu hdfs broker
"hdfs_broker",数据根目录为:hdfs://hadoop-name-node:54310/path/to/repo/
+
+```sql
+CREATE REPOSITORY `hdfs_repo`
+WITH BROKER `hdfs_broker`
+ON LOCATION "hdfs://hadoop-name-node:54310/path/to/repo/"
+PROPERTIES
+(
+ "username" = "user",
+ "password" = "password"
+);
+```
+
+4. 创建名为 s3_repo 的仓库,直接链接云存储,而不通过broker.
+
+```sql
+CREATE REPOSITORY `s3_repo`
+WITH S3
+ON LOCATION "s3://s3-repo"
+PROPERTIES
+(
+ "AWS_ENDPOINT" = "http://s3-REGION.amazonaws.com",
+ "AWS_ACCESS_KEY" = "AWS_ACCESS_KEY",
+ "AWS_SECRET_KEY"="AWS_SECRET_KEY",
+ "AWS_REGION" = "REGION"
+);
+```
+
### Keywords
CREATE, REPOSITORY
### Best Practice
+1. 一个集群可以创建过多个仓库。只有拥有 ADMIN 权限的用户才能创建仓库。
+2. 任何用户都可以通过 [SHOW REPOSITORIES](../../Show-Statements/SHOW-REPOSITORIES.html)
命令查看已经创建的仓库。
+3. 在做数据迁移操作时,需要在源集群和目的集群创建完全相同的仓库,以便目的集群可以通过这个仓库,查看到源集群备份的数据快照。
diff --git
a/new-docs/zh-CN/sql-manual/sql-reference-v2/Data-Definition-Statements/Backup-and-Restore/DROP-REPOSITORY.md
b/new-docs/zh-CN/sql-manual/sql-reference-v2/Data-Definition-Statements/Backup-and-Restore/DROP-REPOSITORY.md
index bb61ff52df..81854d0ef1 100644
---
a/new-docs/zh-CN/sql-manual/sql-reference-v2/Data-Definition-Statements/Backup-and-Restore/DROP-REPOSITORY.md
+++
b/new-docs/zh-CN/sql-manual/sql-reference-v2/Data-Definition-Statements/Backup-and-Restore/DROP-REPOSITORY.md
@@ -26,10 +26,32 @@ under the License.
## DROP-REPOSITORY
+### Name
+
+DROP REPOSITORY
+
### Description
+该语句用于删除一个已创建的仓库。仅 root 或 superuser 用户可以删除仓库。
+
+语法:
+
+```sql
+DROP REPOSITORY `repo_name`;
+```
+
+说明:
+
+- 删除仓库,仅仅是删除该仓库在 Palo 中的映射,不会删除实际的仓库数据。删除后,可以再次通过指定相同的 broker 和 LOCATION
映射到该仓库。
+
### Example
+1. 删除名为 bos_repo 的仓库:
+
+```sql
+DROP REPOSITORY `bos_repo`;
+```
+
### Keywords
DROP, REPOSITORY
diff --git
a/new-docs/zh-CN/sql-manual/sql-reference-v2/Data-Definition-Statements/Backup-and-Restore/RECOVER.md
b/new-docs/zh-CN/sql-manual/sql-reference-v2/Data-Definition-Statements/Backup-and-Restore/RECOVER.md
index adca245140..98000be774 100644
---
a/new-docs/zh-CN/sql-manual/sql-reference-v2/Data-Definition-Statements/Backup-and-Restore/RECOVER.md
+++
b/new-docs/zh-CN/sql-manual/sql-reference-v2/Data-Definition-Statements/Backup-and-Restore/RECOVER.md
@@ -26,10 +26,50 @@ under the License.
## RECOVER
+### Name
+
+REVOCER
+
### Description
+该语句用于恢复之前删除的 database、table 或者 partition
+
+语法:
+
+ 1) 恢复 database
+
+```sql
+RECOVER DATABASE db_name;
+```
+
+ 1) 恢复 table
+ 2) 恢复 partition
+
+说明:
+
+- 该操作仅能恢复之前一段时间内删除的元信息。默认为 1 天。(可通过fe.conf中`catalog_trash_expire_second`参数配置)
+- 如果删除元信息后新建立了同名同类型的元信息,则之前删除的元信息不能被恢复
+
### Example
+1. 恢复名为 example_db 的 database
+
+```sql
+RECOVER DATABASE example_db;
+```
+
+2. 恢复名为 example_tbl 的 table
+
+```sql
+RECOVER TABLE example_db.example_tbl;
+```
+
+3. 恢复表 example_tbl 中名为 p1 的 partition
+
+```sql
+RECOVER PARTITION p1 FROM example_tbl;
+```
+
### Keywords
RECOVER
diff --git
a/new-docs/zh-CN/sql-manual/sql-reference-v2/Data-Definition-Statements/Backup-and-Restore/RESTORE.md
b/new-docs/zh-CN/sql-manual/sql-reference-v2/Data-Definition-Statements/Backup-and-Restore/RESTORE.md
index 5c7e313e91..978f8fe6d9 100644
---
a/new-docs/zh-CN/sql-manual/sql-reference-v2/Data-Definition-Statements/Backup-and-Restore/RESTORE.md
+++
b/new-docs/zh-CN/sql-manual/sql-reference-v2/Data-Definition-Statements/Backup-and-Restore/RESTORE.md
@@ -26,13 +26,94 @@ under the License.
## RESTORE
+### Name
+
+RESTORE
+
### Description
+该语句用于将之前通过 BACKUP 命令备份的数据,恢复到指定数据库下。该命令为异步操作。提交成功后,需通过 SHOW RESTORE
命令查看进度。仅支持恢复 OLAP 类型的表。
+
+语法:
+
+```sql
+RESTORE SNAPSHOT [db_name].{snapshot_name}
+FROM `repository_name`
+[ON|EXCLUDE] (
+ `table_name` [PARTITION (`p1`, ...)] [AS `tbl_alias`],
+ ...
+)
+PROPERTIES ("key"="value", ...);
+```
+
+说明:
+- 同一数据库下只能有一个正在执行的 BACKUP 或 RESTORE 任务。
+- ON 子句中标识需要恢复的表和分区。如果不指定分区,则默认恢复该表的所有分区。所指定的表和分区必须已存在于仓库备份中。
+- EXCLUDE 子句中标识不需要恢复的表和分区。除了所指定的表或分区之外仓库中所有其他表的所有分区将被恢复。
+- 可以通过 AS 语句将仓库中备份的表名恢复为新的表。但新表名不能已存在于数据库中。分区名称不能修改。
+- 可以将仓库中备份的表恢复替换数据库中已有的同名表,但须保证两张表的表结构完全一致。表结构包括:表名、列、分区、Rollup等等。
+- 可以指定恢复表的部分分区,系统会检查分区 Range 或者 List 是否能够匹配。
+- PROPERTIES 目前支持以下属性:
+ - "backup_timestamp" = "2018-05-04-16-45-08":指定了恢复对应备份的哪个时间版本,必填。该信息可以通过
`SHOW SNAPSHOT ON repo;` 语句获得。
+ - "replication_num" =
"3":指定恢复的表或分区的副本数。默认为3。若恢复已存在的表或分区,则副本数必须和已存在表或分区的副本数相同。同时,必须有足够的 host 容纳多个副本。
+ - "timeout" = "3600":任务超时时间,默认为一天。单位秒。
+ - "meta_version" = 40:使用指定的 meta_version 来读取之前备份的元数据。注意,该参数作为临时方案,仅用于恢复老版本
Doris 备份的数据。最新版本的备份数据中已经包含 meta version,无需再指定。
+
### Example
+1. 从 example_repo 中恢复备份 snapshot_1 中的表 backup_tbl 到数据库 example_db1,时间版本为
"2018-05-04-16-45-08"。恢复为 1 个副本:
+
+```sql
+RESTORE SNAPSHOT example_db1.`snapshot_1`
+FROM `example_repo`
+ON ( `backup_tbl` )
+PROPERTIES
+(
+ "backup_timestamp"="2018-05-04-16-45-08",
+ "replication_num" = "1"
+);
+```
+
+2. 从 example_repo 中恢复备份 snapshot_2 中的表 backup_tbl 的分区 p1,p2,以及表 backup_tbl2
到数据库 example_db1,并重命名为 new_tbl,时间版本为 "2018-05-04-17-11-01"。默认恢复为 3 个副本:
+
+```sql
+RESTORE SNAPSHOT example_db1.`snapshot_2`
+FROM `example_repo`
+ON
+(
+ `backup_tbl` PARTITION (`p1`, `p2`),
+ `backup_tbl2` AS `new_tbl`
+)
+PROPERTIES
+(
+ "backup_timestamp"="2018-05-04-17-11-01"
+);
+```
+
+3. 从 example_repo 中恢复备份 snapshot_3 中除了表 backup_tbl 的其他所有表到数据库
example_db1,时间版本为 "2018-05-04-18-12-18"。
+
+```sql
+RESTORE SNAPSHOT example_db1.`snapshot_3`
+FROM `example_repo`
+EXCLUDE ( `backup_tbl` )
+PROPERTIES
+(
+ "backup_timestamp"="2018-05-04-18-12-18"
+);
+```
+
### Keywords
RESTORE
### Best Practice
+1. 同一数据库下只能有一个正在执行的恢复操作。
+
+2. 可以将仓库中备份的表恢复替换数据库中已有的同名表,但须保证两张表的表结构完全一致。表结构包括:表名、列、分区、物化视图等等。
+
+3. 当指定恢复表的部分分区时,系统会检查分区范围是否能够匹配。
+
+4. 恢复操作的效率:
+
+ 在集群规模相同的情况下,恢复操作的耗时基本等同于备份操作的耗时。如果想加速恢复操作,可以先通过设置 `replication_num`
参数,仅恢复一个副本,之后在通过调整副本数 [ALTER TABLE
PROPERTY](../../Data-Definition-Statements/Alter/ALTER-TABLE-PROPERTY.html),将副本补齐。
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]