Updated on 2025-07-31 GMT+08:00

Restoring LakeFormation Metadata and Data

If the metadata lifecycle is configured and metadata or data is deleted, the metadata or data can be restored before the expiration data you set.

The types of data deletion modes and the corresponding deletion policies are as follows:

  • Delete directly: The system marks the metadata for deletion when you delete the data stored in OBS, leading to the irreversible physical erasure of the data.
  • Move to recycle bin: The system marks the metadata for deletion when you delete the data, which consequently moves the data to the recycle bin directory (OBS patch lake-formation-trash-dir/table_id).

Prerequisites

There are deleted metadata or data stored in the recycle bin.

Constraints and Limitations

  • Before restoring table metadata and function metadata, ensure that the number of restored metadata does not exceed the upper limit.
  • Before restoring lower-level metadata, ensure that the upper-level metadata exists.
  • The user must have the permission to create metadata.
  • Metadata restoration will fail if there are metadata files sharing the same name.
  • Metadata that is being deleted cannot be restored.
  • Metadata that is being restored cannot be deleted.

Restoring Catalog Metadata and Data

  1. Log in to the LakeFormation console.
  2. Select the LakeFormation instance to be operated from the drop-down list on the left and choose Metadata > Catalog in the navigation pane.
  3. Click Restore Catalog. Catalogs whose metadata and data can be restored are displayed.
  4. Click Restore in the Operation column. In the displayed dialog box, click OK.

    After the restoration is complete, you can view the restored catalog information in the catalog list.

Restoring Database Metadata and Data

  1. Log in to the LakeFormation console.
  2. Select the LakeFormation instance to be operated from the drop-down list on the left and choose Metadata > Database in the navigation pane.
  3. Click Restore Database and select the name of the target catalog from the Catalog drop-down list box in the upper right corner. Databases whose metadata and data can be restored are displayed.
  4. Click Restore in the Operation column. In the displayed dialog box, select restoration requirements as required and click OK.

    After the restoration is complete, you can view information about the restored database in the database list.

Restoring Table Metadata and Data

  1. Log in to the LakeFormation console.
  2. Select the target LakeFormation instance from the drop-down list box on the left and choose Metadata > Table.
  3. Click Restore Table. In the upper right corner, select the names of the target catalog and database from the Catalog and Database drop-down lists. Tables whose metadata and data can be restored are displayed.
  4. Click Restore or Restore Data in the Operation column. In the displayed dialog box, select restoration requirements as required and click OK.

    After the restoration is complete, you can view information about the restored table in the data table list.

    • If the current instance has metadata files with the same name, the restoration task will fail.
    • If you choose to restore the data in the OBS recycle bin, ensure that there is available storage space in OBS. Otherwise, the data cannot be restored.

Restoring Function Metadata

  1. Log in to the LakeFormation console.
  2. Select the target LakeFormation instance from the drop-down list box on the left and choose Metadata > Function.
  3. Click Restore Function. In the upper right corner, select the names of the target catalog and database from the Catalog and Database drop-down lists. Functions whose metadata can be restored are displayed.
  4. Click Restore in the Operation column. In the displayed dialog box, click OK.

    After the restoration is complete, you can view information about the restored function in the function list.