Updated on 2025-01-06 GMT+08:00

Restoring a Table to the Original Cluster

Scenario

You can create a table from a cluster or schema snapshot to the original cluster if the table was modified or deleted by mistake.

  • If the current console does not support this feature, contact technical support.
  • Only the tables stored in OBS can be used to restore data to the original cluster.
  • Currently, only cluster- and schema-level snapshots can be used for such restoration.
  • Restoration can be performed only if the snapshot and the cluster are both in the Available state.
  • A table in a read-only cluster cannot be restored.
  • Fine-grained restoration does not support tables in an absolute or relative tablespace.

Prerequisites

Manually enable the fine-grained snapshot.

  1. Choose Management > Snapshots. Alternatively, in the cluster list, click the name of the target cluster to switch to the Cluster Information page. Then, click Snapshots.
  2. Click Create Snapshot in the upper right corner. Alternatively, choose More > Create Snapshot in the Operation column.
  3. Click next to Snapshot Level and click Set.

  4. On the Snapshot List page, toggle the fine-grained snapshot switch.

    : enabled

    : disabled

    • If the fine-grained snapshot is enabled, you can create snapshots for specific schemas.
    • If the fine-grained snapshot is enabled, you can restore specific tables from automatic or manual snapshots.

Procedure

  1. Log in to the GaussDB(DWS) console.
  2. Choose Management > Snapshots. Alternatively, in the cluster list, click the name of the target cluster to switch to the Cluster Information page. Then, click Snapshots. All snapshots are displayed by default.
  3. Locate the row that contains the target snapshot, click Restore.
  4. On the Restore Table page, configure the following parameters:

    • Database: To restore a cluster snapshot, select a database. To restore a schema snapshot, select the database specified during backup. For details, see Creating a Manual Snapshot of a Cluster and Creating a Manual Snapshot of a Schema.
    • Source Schema: Specify the schema of the table to be restored.
    • Source Table: Specify the name of the table to be restored.
    • Destination Schema: Specify the schema where the table is to be restored to.
    • Destination Table: Specify the name of the new table.

    Figure 1 Table-level restoration
    • A table name must meet the following GaussDB(DWS) database naming constraints: The table name is case sensitive can contain up to 63 characters. It must start with a letter or underscore (_). Letters, digits underscores (_) are allowed.
    • The source table to be restored must be a table in the backup set, or the restoration will fail.
    • If the target table already exists in the database, this table will be overwritten during restoration. Check the table name before starting restoration.

  5. Confirm the information and click Restore.