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

# Data Recovery

> Recover mistakenly deleted databases/tables/partitions.

Recover mistakenly deleted databases/tables/partitions. After `drop table` or `drop database`, the database will not physically delete the data immediately, but keep it in Trash for a period of time (1 day by default). Administrators can recover the mistakenly deleted data with the `RECOVER` command.

## Related commands

Syntax:

```sql theme={null}
-- 1) Recover database
RECOVER DATABASE db_name;
-- 2) Recover table
RECOVER TABLE [db_name.]table_name;
-- 3) Recover partition
RECOVER PARTITION partition_name FROM [db_name.]table_name;
```

## Notes

1. This operation can only restore the deleted meta information. The default time is 1 day, which can be configured by the `catalog_trash_expire_second` parameter in `fe.conf`.
2. If new meta information of the same name and type is created after the meta information is deleted, the previously deleted meta information cannot be restored.

## Examples

1. Recover the database named `example_db`

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

2. Recover the table named `example_tbl`

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

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

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


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