VeloDB Cloud
SQL Manual
Statments
Database-Administration-Statements
RECOVER

RECOVER

Name

RECOVER

Description

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

You can get all meta informations that can be recovered by statement SHOW CATALOG RECYCLE BIN.

Syntax:

  1. restore database

    RECOVER DATABASE db_name;
  2. restore table

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

    RECOVER PARTITION partition_name FROM [db_name.]table_name;

Note:

  • This operation can only restore meta information that was deleted in the previous period (1 day by default). (Configurable through the catalog_trash_expire_second parameter in fe.conf)
  • If you have delete a meta data and create a new one with the same name and same type, then the previously deleted meta data cannot be recovered.

Example

  1. Restore the database named example_db
RECOVER DATABASE example_db;
  1. Restore the table named example_tbl
RECOVER TABLE example_db.example_tbl;
  1. Restore the partition named p1 in table example_tbl
RECOVER PARTITION p1 FROM example_tbl;

Keywords

 RECOVER

Best Practice