Baidu AI Cloud
中国站

百度智能云

Data Warehouse

BACKUP

BACKUP

Description

This statement is used to back up the data in specified database. This command is an asynchronous operation. After successful submission, progress can be viewed by SHOW BACKUP command.

Backup of OLAP-type tables is only supported.

BACKUP SNAPSHOT [db_name.]snapshot_name
TO `repository_name`
ON (
    `table_name` [PARTITION (`p1`, ...)],
    ...
)
PROPERTIES ("key"="value", ...);
  • snapshot_name: give the snapshot of this backup a name.
  • ON: specify the table or partition to back up.
  • PROPERTIES: specify some parameters

    • timeout: Task timeout period, default to one day, in seconds.

Example

  1. Backup the table example_tbl under example_db to respository example_repo :

    BACKUP SNAPSHOT example_db.snapshot_label1
    TO example_repo
    ON (example_tbl);
  2. Back up the p1, p2 partition of table example_tbl under example_db, and set the timeout.

    BACKUP SNAPSHOT example_db.snapshot_label2
    TO example_repo
    ON 
    (
        example_tbl PARTITION (p1,p2),
        example_tbl2
    )
    PROPERTIES
    (
        "timeout" = "7200"
    );

Keywords

BACKUP, SNAPSHOT

Best Practices

  1. Only one backup operation can be performed under the same database.
  2. The backup operation backs up the underlying tables of the specified table or partition and Materialized View. And only one copy is backed up.
  3. Efficiency of backup operation

    The efficiency of backup operation depends on the amount of data, the number of Compute Node and the number of files. Every Compute Node where backup data slices are located will participate in the upload stage of backup operation. The more nodes, the higher the efficiency of uploading is.

    The amount of file data only involves the number of slices and the number of files in each shard. If there are too many shards, or there are too many small files in the shards, it may increase the backup operation time.

Previous
BROKER-LOAD
Next
EXPORT