> ## Documentation Index
> Fetch the complete documentation index at: /documents/llms.txt
> Use this file to discover all available pages before exploring further.

# RECOVER

> Recovers a database, table, or partition that was dropped by using the DROP command.

Recovers a database, table, or partition that was dropped by using the DROP command. The dropped database, table, or partition can be recovered within the period specified by the FE parameter `catalog_trash_expire_second` (1 day by default).

Data deleted by using [TRUNCATE TABLE](/documents/4.2/sql-reference/sql-statements/table_bucket_part_index/TRUNCATE_TABLE.md) cannot be recovered.

## Syntax

1. Recover a database.

   ```sql theme={null}
   RECOVER DATABASE <db_name>
   ```

2. Recover a table.

   ```sql theme={null}
   RECOVER TABLE [<db_name>.]<table_name>
   ```

3. Recover a partition.

   ```sql theme={null}
   RECOVER PARTITION <partition_name> FROM [<db_name>.]<table_name>
   ```

Note:

1. This command can only recover metadata deleted some time ago (1 day by default). You can change the duration by adjusting the FE parameter `catalog_trash_expire_second`.
2. If the metadata is deleted with identical metadata created, the previous one will not be recovered.

## Examples

1. Recover database `example_db`.

   ```sql theme={null}
   RECOVER DATABASE example_db;
   ```

2. Recover table `example_tbl`.

   ```sql theme={null}
   RECOVER TABLE example_db.example_tbl;
   ```

3. Recover partition `p1` in the `example_tbl` table.

   ```sql theme={null}
   RECOVER PARTITION p1 FROM example_tbl;
   ```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.