Emergency recovery for ApsaraDB RDS for MySQL

更新时间:
复制 MD 格式

Data Disaster Recovery provides an emergency recovery feature for ApsaraDB RDS for MySQL. This feature is based on Copy Data Management (CDM) technology. By enabling the Data Disaster Recovery sandbox, you can quickly create a temporary sandbox instance to serve as an emergency recovery database instance, making your backup data readily available. Read and write operations on different sandbox instances do not affect each other or the source database. Use cases include recovery drills, development and testing, query and analysis, and disaster recovery. This topic describes how to enable and use the emergency recovery feature.

Note

Prerequisites

  • Your RDS MySQL instance meets the following requirements:

    • Edition: High-availability Edition

    • Storage type: Premium Local SSDs

    • Region: China (Hangzhou), China (Shanghai), China (Shenzhen), China (Heyuan), China (Chengdu), China (Beijing), China (Zhangjiakou), China (Hohhot), China (Ulanqab), China (Hong Kong), Singapore, Malaysia (Kuala Lumpur), Indonesia (Jakarta), Japan (Tokyo), or Germany (Frankfurt).

    Note

    You can view this information on the Basic Information page of the instance.

  • At least one physical backup exists in the ApsaraDB RDS console. See Automatic backup or Manual backup.

  • Transparent Data Encryption (TDE) is disabled for the RDS instance.

  • PrivateLink is activated. To activate PrivateLink, use the console or an API operation.

How it works

image

Category

Description

Recovery scope

Restores the entire instance.

Recovery point in time

  • If log backup is disabled, you can restore data only to the point in time of an existing data backup.

  • If log backup is enabled, you can restore data to any point in time after the earliest full backup within the log backup retention period.

    Note

    The system creates sandbox snapshots only after you enable emergency recovery. The earliest recovery point is the time when data preparation completes, and remains fixed until the feature has been active for the full backup retention period.

    For example, you enable the emergency recovery feature at 08:00 on July 1, and the full backup retention period for your RDS instance is 7 days. For the next 7 days, the earliest you can restore data to is the time when the emergency recovery data becomes ready after 08:00 on July 1.

Billing

Emergency recovery incurs fees for sandbox storage and temporary sandbox instances.

Billable item

Description

Sandbox storage fees

After you enable the Data Disaster Recovery sandbox feature, the system allocates a sandbox storage space to each database instance. The system automatically synchronizes data from the database instance to the sandbox storage and creates multiple sandbox snapshots. Data Disaster Recovery charges sandbox storage fees based on the amount of data in the sandbox storage.

Temporary sandbox instance fees

After you restore data to a temporary sandbox instance, Data Disaster Recovery charges fees for the temporary instance based on its specifications and usage duration. These fees are billed on an hourly basis. If you do not create a temporary sandbox instance, no fees apply.

Important

If you enable both the emergency recovery feature described in this topic and the fast restoration for individual databases and tables feature for the same ApsaraDB RDS for MySQL instance, you will incur sandbox storage fees for both features because they both rely on the Data Disaster Recovery sandbox. To completely stop incurring charges for the sandbox, you must disable both the emergency recovery feature and the fast restoration for individual databases and tables feature.

Step 1: Enable sandbox feature

Enable the sandbox feature and configure a sandbox policy before creating a sandbox instance.

  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 navigation pane on the left, click Backup and Restoration.

  3. On the Backup and Restoration page, click the Crash Recovery tab, and then click Enable DBS Sandbox.

  4. In the Set Sandbox Policy dialog box, configure the following parameters:

    Parameter

    Description

    Sandbox Feature

    Enable this feature.

    Sandbox Data Retention Period

    The number of days to retain sandbox snapshots. Default: 7 days.

    • Sandbox snapshots are available after the system creates them. Snapshots are automatically deleted after the retention period ends. Only incremental data (changes relative to the previous snapshot) is removed.

    • You can restore data to any point in time covered by sandbox snapshots, within the log retention period of the RDS instance.

    • A longer retention period requires more storage space and incurs higher storage fees.

    • To keep only the latest snapshot, set the retention period to 0.

  5. Click OK.

    After you enable the sandbox feature, the value of the Sandbox instance time range parameter changes to Data preparing. If you enable the sandbox feature for a backup schedule for the first time, DBS stores the latest full backup set to the sandbox storage and generates a snapshot that can be used to create sandbox instances. DBS requires a specific period of time to copy data. The period of time may be 5 to 20 minutes based on the size of the backup data.

    After a specific time range is displayed as the value of the Sandbox instance time range parameter, you can create a temporary ApsaraDB RDS for MySQL instance and restore data to the temporary ApsaraDB RDS for MySQL instance.

    image.png

    The following table describes the values of the Sandbox instance time range parameter.

    Sandbox state

    Description

    Sandbox feature disabled

    The value of the Sandbox instance time range parameter is Unopened.

    Preparation after you enable the sandbox feature

    The value of the Sandbox instance time range parameter changes to Data preparing.

    Preparation completed

    The value of the Sandbox instance time range parameter changes to the time range in which available backup sets are created.

    Note

    The time range is from the start time of the earliest backup to the end time of the latest backup.

Step 2: Restore data to a sandbox instance

Create a sandbox instance to restore data to a specific point in time.

  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 navigation pane on the left, click Backup and Restoration.

  3. On the Backup and Restoration page, click the Crash Recovery tab, and then click Enable DBS Sandbox.

  4. Click Recover Sandbox Instance. In the dialog box that appears, set the following parameters.

    Section

    Parameter

    Description

    Sandbox Instance Point in Time

    Sandbox Data Time Range

    The recoverable time range, from the first snapshot in sandbox storage to the current time. The actual recoverable range may be shorter.

    Important

    Data can be restored from the first snapshot to the end time of the last binlog file. Restoration is not guaranteed for the period between the last binlog and the current time.

    You can view this information on the Backup and Restoration > Base Backups > Log Backup tab.

    Recovery Method

    • Recovery by Snapshot Point in Time (Recommended): Select from existing snapshot points. Faster restoration.

    • Recovery by Custom Point in Time: If log backup for ApsaraDB RDS for MySQL is enabled, restore data to any point within the log retention period. Restoration duration depends on log size. Without log backup, you can only restore to full backup points.

      Note

      Point-in-time recovery requires RDS MySQL High-availability Edition with log backup enabled.

    Sandbox Instance Configurations

    Specifications

    Specifications do not significantly affect restoration speed but determine post-restoration performance. Eight specifications are available:

    • 1 Core, 1 GB Memory

    • 1 Core, 2 GB Memory

    • 2 Cores, 4 GB Memory

    • 2 Cores, 8 GB Memory

    • 4 Cores, 8 GB Memory

    • 4 Cores, 16 GB Memory

    • 8 Cores, 16 GB Memory

    • 8 Cores, 32 GB Memory

    Region

    Fixed to the region of the source instance.

    Peer VPC

    Select a VPC.

    Note

    To access the sandbox instance from an ECS instance, select the VPC where the ECS instance resides. Create and manage a VPC.

    Peer vSwitch

    Select a vSwitch to assign an IP address range for the sandbox instance.

    Security Group

    Select an advanced security group with port 3306 open.

    Note

    This parameter appears only the first time you enable emergency recovery. It does not appear for instances that already have this feature enabled.

    Database Account Type

    Select one of the following:

    • Use Original Database Account: Uses the same account as the source database.

    • Create Privileged Account: Creates a privileged account with permissions on all databases. Enter a new Database Account and Password. Original database accounts are retained.

      Note
      • The privileged account is created only in the current sandbox instance.

      • If an account with the same name exists in the source database, the new privileged account overwrites it in the sandbox instance.

  5. Click OK.

    The system runs a precheck and automatically creates the sandbox instance. After the Sandbox Instance Status changes to "Complete", access the instance through Access a sandbox instance by using DMS or Access a sandbox instance from an ECS instance.

    The sandbox instance inherits the account, password, and configurations from the source backup. If you selected Create Privileged Account, you can also use the new privileged account to access the sandbox instance.

    Note

    The client (for example, an ECS instance) must be in the same VPC as the sandbox instance.

Related operations

Correct online data

Use Data Transmission Service (DTS) to migrate databases or tables from the sandbox instance back to the original instance to correct production data.

Note

When you create the migration task, set the sandbox instance as the source, and for Access Method, select Self-managed Database on ECS. Set the original instance as the destination, and for Access Method, select Alibaba Cloud Instance.

Release the sandbox instance

Release the sandbox instance when no longer needed to stop incurring sandbox storage fees.

On the instance details page, go to the Restoration page. On the Emergency Recovery tab, click Release Sandbox Instance.

Disable emergency recovery

Disable emergency recovery when no longer needed. Existing sandbox instances are not affected.

On the instance details page, go to the Restoration page. On the Emergency Recovery tab, click Set Sandbox Policy and turn off the Sandbox Feature.

Important

The emergency recovery feature and the fast restoration for individual databases and tables feature are both based on the Data Disaster Recovery sandbox. This operation disables only the emergency recovery feature and does not affect the use or billing of the fast restoration for individual databases and tables feature.