# FLASHBACK DATABASE

+ Recover a database and its data that are deleted by the DROP statement.
```
FLASHBACK DATABASE db1 TO db2;
```

-----------------------------------------------------------------

TiDB v6.4.0 introduces the FLASHBACK DATABASE syntax. User can use FLASHBACK DATABASE to recover a database and its data that are deleted by the `DROP` statement within the `Garbage Collection (GC)` life time.

If the database is deleted before the `tikv_gc_safe_point` time, you cannot recover the data using the `FLASHBACK DATABASE` statement. The `FLASHBACK DATABASE` statement returns an error similar to `ERROR 1105 (HY000)`: `Can't find dropped database 'test' in GC safe point 2024-05-20 16:10:10 +0800 CST.`

You cannot recover the same database multiple times using the `FLASHBACK DATABASE` statement. Because the database recovered by `FLASHBACK DATABASE` has the same `schema ID` as the original database, restoring the same database multiple times leads to duplicate `schema IDs`. In TiDB, the database `schema ID` must be globally unique.