Files
doris/new-docs/en/sql-manual/sql-reference-v2/Database-Administration-Statements/RECOVER.md
jiafeng.zhang 4cfb372387 [refactor][Doc] Database admin sql help (#9009)
* Add SQL function Chinese documentation

Add SQL function Chinese documentation

* Add database management SQL help documentation

Add database management SQL help documentation
2022-04-14 09:02:33 +08:00

2.0 KiB

title, language
title language
RECOVER en

RECOVER

Name

RECOVER

Description

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

grammar:

  1. Restore the database

    ```sql
     RECOVER DATABASE db_name;
    ````
    
  2. Restore the table

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

    ```sql
    RECOVER PARTITION partition_name FROM [db_name.]table_name;
    ````
    

illustrate:

  1. This operation can only restore meta information that was deleted within a certain period of time. Default is 1 day. (Configurable through the catalog_trash_expire_second parameter in fe.conf)
  2. 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;

    RECOVER DATABASE example_db;
    
  2. Restore the table named example_tbl

    RECOVER TABLE example_db.example_tbl;
    
  3. Restore the partition named p1 in table example_tbl

    RECOVER PARTITION p1 FROM example_tbl;
    

Keywords

RECOVER

Best Practice