All Products
Search
Document Center

ApsaraDB RDS:Restore individual databases and tables

Last Updated:Nov 22, 2023

The fast restoration feature for individual databases and tables is supported for ApsaraDB RDS for PostgreSQL instances. This feature allows you to restore specific databases to the original ApsaraDB RDS for PostgreSQL instance by backup set or point in time. This feature can be used in scenarios when accidental operations are performed and data needs to be quickly restored or when historical data needs to be analyzed.

Feature description

Item

Description

Restoration range

Specific databases on an RDS instance.

Note

The restoration range varies based on data backup retention period, log backup retention period, and the point in time at which you enable the fast restoration feature for individual databases and tables of your RDS instance. The maximum retention period is 730 days for both data backup files and log backup files. For more information, see Back up an ApsaraDB RDS for PostgreSQL instance. You can call the DescribeLocalAvailableRecoveryTime operation to query the time range within which an RDS instance can be restored. For more information, see DescribeLocalAvailableRecoveryTime.

Restoration speed

The restoration speed varies based on the data volume of the databases, which is approximately 20 Mbit/s.

Restoration method

You can restore data from backup files or to a specific point in time.

Note

Prerequisites

Billing rules

The fast restoration feature for individual databases and tables is in public preview. You can use the feature free of charge.

Limits

  • You can use the fast restoration feature for individual databases and tables to restore individual databases or tables of an RDS instance only to the original RDS instance.

  • You can use the fast restoration feature for individual databases and tables to restore databases not tables.

  • You cannot use the fast restoration feature for individual databases and tables to restore views.

  • The databases whose names start with postgres, rdsadmin, and template cannot be restored.

Enable the fast restoration feature for individual databases and tables

To use the fast restoration feature for individual databases and tables to restore data, you must perform the following steps to enable the feature before you restore data. For more information, see Restore individual databases and tables of an ApsaraDB RDS for PostgreSQL instance. Enabling the feature does not affect your workloads.

  1. Go to the Instances page. In the top navigation bar, select the region in which the RDS instance resides. Then, find the RDS instance and click the ID of the instance.
  2. In the left-side navigation pane of the page that appears, click Backup and Restoration.

  3. On the page that appears, click the Backup Strategy tab.

  4. In the Backup Strategy section of the page that appears, click Edit. In the dialog box that appears, turn on Fast Restoration.

  5. Click Save.

Procedure

  1. Go to the Instances page. In the top navigation bar, select the region in which the RDS instance resides. Then, find the RDS instance and click the ID of the instance.
  2. In the left-side navigation pane of the page that appears, click Backup and Restoration. On the page that appears, click Restore Individual Database/Table.

    Note

    If the Restore Individual Database/Table button is not displayed in the ApsaraDB RDS console, check whether the requirements that are described in Prerequisites are met.

  3. Configure the following parameters.

    Parameter

    Description

    Restore To

    Set the value to Current Instance.

    Restore Speed

    Set the value to Fast.

    Restore Method

    • By Backup Set: If you select this option, you can restore the data from a backup set.

    • By Time: The By Time option is displayed only if the log backup feature is enabled for the RDS instance. The system restores full backup data and then incremental log backup data. You can select a point in time within the log backup retention period. If you want to enable the log backup feature or modify the log backup retention period, follow the instructions in Back up an ApsaraDB RDS for PostgreSQL instance.

      For example, if the data backup retention period and the log backup retention period of an RDS instance are seven days, you can restore data that is generated within the last seven days. Backup sets that were generated seven days ago are not retained and cannot be used for restoration.

  4. Select the databases that you want to restore and click Ok. You can specify the names of the restored databases based on your business requirements.

    Note
    • You can select up to 50 databases at a time.

    • If you restore data to the original RDS instance, the names of the restored databases can be the same as the names of the original databases. The system automatically adds _backup to the end of the name of a restored database. You can also modify the database name.

    • If you restore data to the original RDS instance, you must check the size of the selected databases and the remaining storage capacity of the RDS instance to ensure that the remaining storage capacity is sufficient for the data restoration.

  5. After the restoration is complete, view the restored databases on the Databases page.

FAQ

  • What do I do if the "The operation failed. The RDS instance is not in a ready state." error message is displayed when I restore a database or table of my RDS instance in the ApsaraDB RDS console?

    Tasks in the ApsaraDB RDS console are executed in sequence. If an ongoing restoration task or incomplete task exists, this error message is displayed when you execute another restoration task at the same time. In this case, wait until the ongoing restoration task or incomplete task is complete and then execute another restoration task.

  • What do I do if the restored table is empty?

    Make sure that the table contains data at the point in time that you selected for the restoration. If the table does not contain data at the point in time that you selected for the restoration, you must select a table that contains data at the selected point in time.

  • What other methods can I use to restore individual databases and tables of an RDS instance?

    You can use Database Backup (DBS) to back up and restore RDS instances and self-managed databases that reside on Elastic Compute Service (ECS) instances. You can also use DBS to download backup sets from the cloud to your computer. For more information, see Overview.

    Note

    For more information about other data restoration methods, see Restore data by database or table.

Related operations

Operation

Description

DescribeLocalAvailableRecoveryTime

Queries the time range within which you can restore data of an instance.