RECOVER
Descriptionβ
This statement is used to recover deleted database, table or partition.
Syntax:
-
Recover database
RECOVER DATABASE <db_name>
-
Recover database
RECOVER TABLE [<db_name>.]<table_name>
-
Recover partition
RECOVER PARTITION partition_name FROM [<db_name>.]<table_name>
Note:
- It can only recover meta-information deleted some time ago. The default time: one day. (You can change it through parameter configuration catalog_trash_expire_second in fe.conf. )
- If the meta-information is deleted with an identical meta-information created, the previous one will not be recovered.
Examplesβ
-
Recover database named example_db
RECOVER DATABASE example_db;
-
Recover table name example_tbl
RECOVER TABLE example_db.example_tbl;
-
Recover partition named p1 in the example_tbl table
RECOVER PARTITION p1 FROM example_tbl;