[docs] update backup and restore docs (#8161)

Co-authored-by: 段绪建 <duanxujian@jd.com>
This commit is contained in:
Xujian Duan
2022-02-23 11:41:14 +08:00
committed by GitHub
parent b1e7343532
commit f4c6de554b
4 changed files with 45 additions and 14 deletions

View File

@ -30,7 +30,7 @@ This statement is used to backup data under the specified database. This command
Grammar:
BACKUP SNAPSHOT [db_name].{snapshot_name}
TO `repository_name`
ON (
[ON|EXCLUDE] (
`Table_name` [partition (`P1',...)],
...
)
@ -39,7 +39,8 @@ PROPERTIES ("key"="value", ...);
Explain:
1. Only one BACKUP or RESTORE task can be performed under the same database.
2. 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.
3. PROPERTIES currently supports the following attributes:
3. The EXCLUDE clause identifies the tables and partitions that need not to be backed up. All partitions of all tables in the database except the specified tables or partitions will be backed up.
4. PROPERTIES currently supports the following attributes:
"Type" = "full": means that this is a full update (default).
"Timeout" = "3600": Task timeout, default to one day. Unit seconds.
@ -60,6 +61,11 @@ example_tbl PARTITION (p1,p2),
Example:
);
3. Back up all tables in example_db except example_tbl to the warehouse example_repo:
BACKUP SNAPSHOT example_db.snapshot_label3
TO example_repo
EXCLUDE (example_tbl);
## keyword
BACKUP

View File

@ -31,7 +31,7 @@ This statement is used to restore the data previously backed up by the BACKUP co
Grammar:
SNAPSHOT RESTORE [dbu name].{snapshot name}
FROM `repository_name`
ON (
[ON|EXCLUDE] (
"`Table `uname'[`partition (`p1',...)] [as `tbl `uu alias'],
...
)
@ -40,10 +40,11 @@ PROPERTIES ("key"="value", ...);
Explain:
1. Only one BACKUP or RESTORE task can be performed under the same database.
2. The ON clause identifies the tables and partitions that need to be restored. If no partition is specified, all partitions of the table are restored by default. The specified tables and partitions must already exist in the warehouse backup.
3. The backup tables in the warehouse can be restored to new tables through AS statements. But the new table name cannot already exist in the database. Partition name cannot be changed.
4. The backup tables in the warehouse can be restored and replaced with the same-name tables in the database, but the table structure of the two tables must be completely consistent. Table structure includes: table name, column, partition, Rollup and so on.
5. Partitions of the recovery table can be specified, and the system checks whether the partition Range or List matches.
6. PROPERTIES currently supports the following attributes:
3. The EXCLUDE clause identifies the tables and partiitons that need not to be restored. All partitions of all tables in the warehouse except the specified tables or partitions will be restored.
4. The backup tables in the warehouse can be restored to new tables through AS statements. But the new table name cannot already exist in the database. Partition name cannot be changed.
5. The backup tables in the warehouse can be restored and replaced with the same-name tables in the database, but the table structure of the two tables must be completely consistent. Table structure includes: table name, column, partition, Rollup and so on.
6. Partitions of the recovery table can be specified, and the system checks whether the partition Range or List matches.
7. PROPERTIES currently supports the following attributes:
"Backup_timestamp" = "2018-05-04-16-45-08": specifies which version of the time to restore the corresponding backup must be filled in. This information can be obtained through the `SHOW SNAPSHOT ON repo;'statement.
"Replication_num" = "3": Specifies the number of replicas of the restored table or partition. The default is 3. If an existing table or partition is restored, the number of copies must be the same as the number of copies of an existing table or partition. At the same time, there must be enough hosts to accommodate multiple copies.
"Timeout" = "3600": Task timeout, default to one day. Unit seconds.
@ -73,6 +74,14 @@ PROPERTIES
"backup_timestamp"="2018-05-04-17-11-01"
);
3. Restore backup all partiitons of all tables in snapshot_3 from example_repo to database example_db1 except backup_tbl with the time version of "2018-05-04-18-12-18".
RESTORE SNAPSHOT example_db1.`snapshot_3`
FROM `example_repo`
EXCLUDE ( `backup_tbl` )
PROPERTIES
(
"backup_timestamp"="2018-05-04-18-12-18"
);
## keyword
RESTORE