RECOVER

Name

RECOVER

Description

This statement is used to restore a previously deleted database, table or partition

grammar:

  1. restore database

    1. RECOVER DATABASE db_name;
  2. restore table

    1. RECOVER TABLE [db_name.]table_name;
  3. restore partition

    1. RECOVER PARTITION partition_name FROM [db_name.]table_name;

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
  1. RECOVER DATABASE example_db;
  1. Restore the table named example_tbl
  1. RECOVER TABLE example_db.example_tbl;
  1. Restore the partition named p1 in table example_tbl
  1. RECOVER PARTITION p1 FROM example_tbl;

Keywords

  1. RECOVER

Best Practice