Can TiDB support flashback to its own server?

This topic has been translated from a Chinese forum by GPT and might contain errors.

Original topic: 问一下tidb能支持闪回到自己这台服务器么

| username: tidb狂热爱好者

[TiDB Usage Environment] Production Environment / Testing / PoC
[TiDB Version]
[Reproduction Path] What operations were performed when the issue occurred
[Encountered Issue: Issue Phenomenon and Impact]
[Resource Configuration] Enter TiDB Dashboard - Cluster Info - Hosts and take a screenshot of this page
[Attachments: Screenshots/Logs/Monitoring]
Oracle supports powerful flashback features, usage scenarios:

  1. flashback database: Database flashback; mainly used for database recovery, accidental deletion of databases, users, or tablespaces.

  2. flashback table: Table flashback; used for data table recovery; accidental deletion of data tables.

  3. flashback query: Flashback query; used to repair misoperated data.

Using br for full backup + logs can achieve flashback. But you must set up a new TiDB.
Is there a command to directly restore historical table data within a single TiDB setup without copying?

| username: h5n1 | Original post link

Flashback Cluster

| username: tidb狂热爱好者 | Original post link

If you do it this way, the data will be lost.

| username: h5n1 | Original post link

TiDB also supports flashback table/flashback query.

| username: zhanggame1 | Original post link

Full backup + logs
Then clean up the data in the source database and import directly.

| username: 像风一样的男子 | Original post link

If within the GC time, you can directly use Dumpling to specify TSO data and then import it into the specified table you want. This is when the 30-day GC really shows its power.

| username: 小龙虾爱大龙虾 | Original post link

Adjust the GC time to six months :smiley_cat:

| username: TiDBer_HUfcQIJx | Original post link

Flashback is possible.

| username: tidb菜鸟一只 | Original post link

TiDB also has flashback, based on GC time.
Oracle is also based on your undo space and undo retention time, it’s the same.

| username: zhaokede | Original post link

Adjust the GC time first, then perform the flashback.

| username: 濱崎悟空 | Original post link

GC needs to be adjusted a lot, haha.

| username: 鱼跃龙门 | Original post link

Check the official documentation, adjust GC for flashback, and take a look at the precautions.

| username: forever | Original post link

What you posted already meets the requirements :joy: