Recover Metadata for Other Objects

When normal export of views, triggers, routines or events is unavailable but matching physical sources survive, use PDU to extract metadata. The following sections describe preparation and operations for each object type.

I. Prepare Original Evidence

Preserve the exact version and matching TRG/TRN, MYD/MYI, FRM, original DDL or mysql.ibd. Record object definitions, account privileges, session context and dependencies separately.

II. Read Object Information from Files

meta view /recovery-input/view.frm 50744;
meta trigger /recovery-input/table.TRG 50744 summary;
meta trigger-map /recovery-input/table.TRG /recovery-input/trigger.TRN 50744 summary;
meta routine /recovery-input/proc.MYD /recovery-input/proc.MYI /recovery-input/proc.sql /recovery-input/proc.frm 50744 summary;

Paths and versions are syntax examples; replace them for actual objects. summary shows a summary only and does not mean a complete creation script has been generated.

III. Generate Trigger Creation Evidence

meta trigger-create /recovery-input/table.TRG /recovery-input/trigger.TRN 50744;

Retain the native CREATE and session context. Confirm target collation, accounts, privileges, dependencies and execution separately. PDU does not automatically create business objects.

IV. Generate View Creation Evidence

meta view-create /recovery-input/appdb/orders_view.frm 50744 appdb orders_view;

Explicit database and view names must match the original database directory and FRM filename. Retain algorithm, security type, CHECK OPTION, definer, normalized query and character-set context. The original VIEW SQL mode is not stored, so complete recovery of the original session context cannot be claimed.

V. Generate Routine Creation Evidence

meta routine-create /recovery-input/proc.MYD /recovery-input/proc.MYI /recovery-input/proc.sql /recovery-input/proc.frm 50744 appdb calculate_total FUNCTION;
meta routine-create /recovery-input/proc.MYD /recovery-input/proc.MYI /recovery-input/proc.sql /recovery-input/proc.frm 50744 appdb rebuild_summary PROCEDURE;

Use matching MYD/MYI, original DDL and FRM, with explicit database, routine-name and FUNCTION/PROCEDURE bindings. Retain parameters, return types, body, definer, SQL mode and character-set context. Creation evidence includes short client delimiters and session save/restore statements.

IV. Extract Sparse DD Object Attributes

meta objects /recovery-input/mysql.ibd appdb 80046 summary;
ds objects <DS_TASK> 1 1 0 appdb 80046 summary;

Sparse DD is currently limited to declared 8.0.28/8.0.46 source profiles. With proven domain and generation, SOURCE_ID is 0. When both domain and generation are unknown and 0, specify a concrete nonzero source ID. Do not reuse example identities for other sources.

This path extracts object attributes without guaranteeing complete CREATE, transaction states, dependencies or database completeness. Known damage retains surviving objects and PARTIAL. Stop when attribution or SDI evidence is missing.

Output Files

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 文档