Recover Dropped Tables Without Backup

When a MySQL table has been dropped or truncated and no directly restorable backup is available, use DropScan to find recovery evidence in preserved disk pages.


I. Preserve the Disk Image Immediately

Before scanning, have the incident engineer preserve a stable disk image. Launch PDU outside the source files. Task records and exported output are saved in the launch directory.

PDU_DROPSCAN_SOURCES 1
source 1 image 1 1 cold-A "/recovery-input/disk.image" 0 0 512 16777216 31 1

Replace the example path, domain, generation and scan range with actual evidence. Use 0 for unknown domains and generations without inferring them.

1.2 Run ds idx First

Launch PDU in the result directory. ds idx reports DS_TASK. Replace <DS_TASK> in subsequent examples with the absolute task path from this run; do not specify another output directory.

ds idx /recovery-input/sources.manifest;
ds show <DS_TASK> metadata;
ds show <DS_TASK> objects;

ds idx preserves page and metadata candidates without exporting business data. Completion means only that the declared scan range was processed.


II. Obtain Table Structure

For version 8.0, select definitions from surviving SDI. Version 5.7 uses SYS_TABLES, SYS_INDEXES and matching FRM. Original DDL, Binlog Table_map and historical definitions can provide additional evidence; schema compatibility and business attribution are assessed separately.


III. Configure Table Structure Manually (If Needed)

PDU_DROPSCAN_BINDING 1
object "appdb.orders" 1 1 1 42 1234 16384 8 2 STATIC 268435456 0
evidence "Matching source generation and clustered-index evidence"
ddl
CREATE TABLE orders (id INT NOT NULL, value LONGBLOB, PRIMARY KEY (id)) ROW_FORMAT=DYNAMIC;
ds bind <DS_TASK> /recovery-input/binding.manifest orders-A;

IV. Parse the Preserved Pages

ds unload <DS_TASK> orders-A;

Secondary-index, SDI and FULLTEXT auxiliary pages cannot be exported directly as complete business rows. Retain separate reasons for damaged pages, missing pages, opaque ciphertext and conflicts.


V. Restore External Large Values

LOB dependencies must come from matching tablespaces and object generations. When fragments or dependencies change, create a new recovery view with separate output and retain the parent view's native completion records.


VI. Use Recovery SQL

After confirming the recovery object and matching DDL, create the table and import SQL in an isolated target database. Successful parsing establishes only that observed records can be decoded, not database completeness or committed transactions.


Output Files

After export, record the native success and failure counts and original errors reported by PDU, and retain the checkpoint. Resume uses native records and file metadata such as existence and size without rereading exported data.

ds resume idx <DS_TASK>;
ds resume unload <DS_TASK> orders-A;

PHASE=PAUSED CHECKPOINT_SAVED=1 indicates a safe pause, not completion. Resume with the same task, binding, source and program identity.


Q&A: Common Scenarios

  • Only scattered pages remain: preserve candidates and positions, then obtain schema and attribution evidence.
  • Multiple definitions decode successfully: retain ambiguity without choosing one automatically.
  • Pages have been overwritten: parsing cannot recreate data that no longer exists.
MySQL 文档