Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.
Original topic: TiDB误删数据怎么恢复
If a table is deleted from the database and then a new identical table is created, can the data be recovered using flashback if it is still within the GC time period?
What specific operations did you perform? Please share the deployment configuration diagram~
Sure, first increase the GC time to prevent data from being GC’d. Set the snapshot to the time period closest to the misoperation using set session tidb_snapshot = ****
, query the data, and restore the queried data as needed.
Sure, first roll back the snapshot to the point in time when the original table existed, then export the corresponding table. After canceling the snapshot, re-import the original table.
You can use the flashback feature to recover data before GC.
You can still export data backups at a specified time before GC.
./dumpling --snapshot “2024-07-02 17:12:45”
This is simple, FLASHBACK TABLE table_name [TO other_table_name]
The above methods are too complicated.
Sure. Generally, having a larger GC is better; otherwise, the recovery time from accidental operations can be a bit troublesome.
The image you provided is not accessible. Please provide the text you need translated.
Check if MVCC has saved historical data.
Increase the GC time to give yourself more leeway 
Set the GC time a bit longer, it will come back.
The solution in this blog post is quite comprehensive.
First, increase the GC interval, then use flashback to restore.
First, adjust the GC time to be longer. If the data has not been GC’d, you can use dumpling+lightning or flashback for operations later.