Recover Scattered InnoDB Pages

When directories or table files are lost but disk images and scattered InnoDB pages survive, use DropScan to scan, bind definitions and export parseable records. The following sections describe sources, candidates and fragment supplementation in detail.


I. Initialize the Scan Task

Prepare the source manifest and scan task as described in dropped-table recovery.

Launch PDU in the result directory. The first scan reports DS_TASK beneath .pdu-work. Replace <DS_TASK> with the absolute native task path from this run; parent uses the corresponding parent recovery-task path.

ds idx /recovery-input/sources.manifest chunks 4;
ds show <DS_TASK> sources;
ds show <DS_TASK> candidates;

chunks limits persistent scan windows for a run. PHASE=PAUSED CHECKPOINT_SAVED=1 is a safe pause, not completion of the full scan.


II. Obtain Schema and Source Evidence

ds show <DS_TASK> metadata;
ds show <DS_TASK> objects;
ds show <DS_TASK> conflicts;

Version 8.0 uses explicitly selected SDI candidates. Version 5.7 uses SYS_TABLES/SYS_INDEXES and matching FRM. Retain raw and record offsets, mappings, tablespaces, clustered indexes and metadata-write versions separately. Metadata versions do not directly identify the source server version.


III. Bind Table Definitions

ds bind <DS_TASK> /recovery-input/binding.manifest orders-A;

DDL, SDI, SYS/FRM, compressed and encrypted sources use their corresponding binding formats. Explicitly select matching sources and reasons for external LOB, keys and metadata replacement pages. Retain AMBIGUOUS when multiple definitions decode successfully.


IV. Parse Sparse Pages

ds unload <DS_TASK> orders-A units 4;

Parse records from clustered business pages. Secondary indexes, SDI and FULLTEXT auxiliary pages are not complete business rows. Retain separate reasons for missing pages, damaged pages, opaque ciphertext and I/O errors without zero filling.


V. Supplement LOB and Metadata Pages

Adding fragments or changing dependencies or bindings creates a new saved recovery view and internal task. SQL is exported directly to the launch directory. Specify parent to reuse completed units from the parent task. PDU's dependency rules determine what can be reused or must be recalculated; parent output is not modified.

ds unload <DS_TASK> orders-B parent <PARENT_RECOVERY_TASK>;

VI. Continue the Recovery Task

ds resume idx <DS_TASK> chunks 4;
ds resume unload <DS_TASK> orders-A units 4;

Keep original sources, bindings, build and policy unchanged. When sources or identity change, retain old evidence and use a new task. Do not resolve conflicts by appearance order or maximum LSN.


VII. Use Sparse Redo/Undo Sources

Sparse pages can use the independent PDU_DROPSCAN_LOG_BINDING 2 log policy. Redo requires a real baseline, a complete-MTR cutoff and an object lifecycle. Undo requires historical roots, roll-pointer mappings and explicit commit sequences without first reconstructing a complete TRX_SYS/FSP.

Redo LSNs and Undo commit sequences are not interchangeable. Preserve selection evidence across frozen copies through explicit undo-freeze and per-page undo-select. Unselected pages remain missing and the maximum LSN does not win automatically. Encrypted logs and Undo need their own matching key sources. Missing commit evidence, purged history and unverifiable LOB values remain isolated.

See evidence requirements for ordinary Undo/Redo and offline reconstruction.


VIII. Handle Damaged and Delete-Marked Pages

Use PDU_DROPSCAN_SALVAGE_BINDING 1 to declare an explicit policy and reason for retaining bad-checksum pages, deleted/free/orphan records or proven retired leaves. Disabled by default, flags are 1, 2 and 4, accepting combinations 1–7. Confirm recovery scope from surviving sources.

Interpretable content with insufficient integrity is written to separate quarantine results rather than normal data SQL; use filenames reported by PDU. Untrusted boundaries, missing pages and incomplete LOB values retain isolation reasons without being treated as confirmed business records.


Output Files

Tasks record the sources, possible matches, confirmed bindings, problems and recovery checkpoints. SQL is exported directly to the launch directory, and internal state is stored in .pdu-work. Success counts refer to parsed and exported records; they do not establish that the entire database was recovered.

After export, record native success and failure counts and original errors. Resume uses records and file metadata such as existence and size without rereading or validating exported data.

MySQL 文档