DBS (DBS) provides an emergency disaster recovery feature to automatically obtain backup sets and generate snapshots. A DBS sandbox instance can be generated in a short period of time.

Background information

DBS provides a complete sandbox solution for MySQL databases based on copy data management (CDM). You can use the sandbox feature of DBS to create a sandbox instance to restore data in a backup set within a short period of time. Read and write operations are performed within sandbox instances and do not affect source databases. You can perform various operations within sandbox instances, such as data restoration, recovery drills, development and testing, query and analysis, and emergency disaster recovery. For more information, see Overview.

Pricing

  • ApsaraDB RDS provides the physical backup of ApsaraDB RDS instances and charges you backup fees. For more information, see Backup storage pricing of an ApsaraDB RDS for MySQL instance.
  • After you enable the sandbox feature, DBS automatically synchronizes the data that are backed up to the sandbox storage and generates snapshots for the data. The snapshots are stored in the sandbox storage and can be used to create sandbox instances. DBS charges you for data storage based on the volume of the data that is stored in the sandbox storage. For more information, see Sandbox storage fees.
  • After you create a sandbox instance, DBS charges you for sandbox instance resources based on the specifications and duration of the sandbox instance. If you do not create sandbox instances, you are not charged for sandbox instance resources. For more information, see Sandbox instance fees.

Prerequisites

  • An ApsaraDB RDS for MySQL instance with local SSDs is created. At least one physical backup is complete in the ApsaraDB RDS console. For more information, see Enable the automatic backup feature for an ApsaraDB RDS for MySQL instance.
  • The ApsaraDB RDS for MySQL instance resides in the China (Hangzhou), China (Shanghai), China South 1 Finance, China (Shenzhen), China (Heyuan), China (Chengdu), China (Beijing), China (Zhangjiakou), China (Hohhot), China (Ulanqab), China (Hong Kong), Singapore, Australia (Sydney), Malaysia (Kuala Lumpur), Indonesia (Jakarta), Japan (Tokyo), India (Mumbai), Germany (Frankfurt), US (Silicon Valley), or US (Virginia) region.
  • Transparent Data Encryption (TDE) is disabled for the ApsaraDB RDS for MySQL instance. For more information about TDE, see Configure TDE for an ApsaraDB RDS for MySQL instance.
  • The ApsaraDB RDS for MySQL instance is of RDS High-availability Edition if you want to use Recovery by Custom Point in Time as the recovery method.
  • The ApsaraDB RDS for MySQL instance is of RDS Enterprise Edition if you want to use Recovery by Snapshot Point in Time as the recovery method.

Enable the sandbox feature

After you enable the sandbox feature, DBS synchronizes the data to be restored to sandbox storage. Then, you can create a sandbox instance for emergency disaster recovery.

  1. Access RDS Instances, select a region at the top, and then click the ID of the target RDS instance.
  2. In the left-side navigation pane, click Backup and Restoration.
  3. On the Backup and Restoration page, click the Crash Recovery tab.
    Emergency instance
  4. Click Enable DBS Sandbox.
  5. In the Set Sandbox Policy dialog box, set the following parameters:
    • Sandbox Feature: By default, the sandbox feature is enabled.
    • Storage Type: the storage type of the sandbox. You need to pay only for capacity-type sandboxes. For more information, see DBS sandbox fees.
      Note
      • If you have high requirements for storage stability and performance of sandbox instances, we recommend that you use performance-type sandboxes.
      • If you want to use performance-type sandboxes, disable capacity-type sandboxes and then enable performance-type sandboxes.
    • Sandbox Data Retention Period: the number of days for which DBS retains the data that is used to create sandbox instances. Default value: 7. By default, DBS retains data in the last seven days. You can restore data to a point in time within the retention period.
  6. Click OK.
    The sandbox feature is enabled. The first time this feature is enabled, DBS stores the latest full backup set of the ApsaraDB RDS for MySQL instance in sandbox storage and generates snapshots that can be used to create sandbox instances. This process may take 5 to 20 minutes based on the backup data size.

    After the available time range is displayed to the right of the Available Time Range to Recover parameter, you can create sandbox instances.

Create a sandbox instance

  1. Access RDS Instances, select a region at the top, and then click the ID of the target RDS instance.
  2. In the left-side navigation pane, click Backup and Restoration.
  3. On the Backup and Restoration page, click the Crash Recovery tab.
    Emergency instance
  4. Click Recover Sandbox Instance.
  5. In the Recover Sandbox Instance dialog box, set the parameters that are described in the following table.
    Configure a sandbox instance
    Section Parameter Description
    Sandbox Instance Point in Time Sandbox Data Time Range The time range available to restore the source database. The available time range is from the point in time at which the first snapshot was created in sandbox storage to the current time. The actual available time range may be shorter. Data can be restored in the time range from the point in time at which the first snapshot was created in sandbox storage to the end time of the latest binary log file. Data may not be restored in the time range from the end time of the latest binary log file to the current time. You can view the end time of the latest binary log file on the Log Backup tab of the Backup and Restoration page.
    Recovery Method The method that is used to restore data. Valid values:
    • Recovery by Snapshot Point in Time: You can select only the point in time at which a snapshot was created. This restoration method takes less time to complete. We recommend that you select this method.
    • Recovery by Custom Point in Time: You can select a specific point in time within the backup set retention period. The amount of time required for the restoration to complete varies based on the backup size.
      Note You can select Recovery by Custom Point in Time only for an ApsaraDB RDS for MySQL High-availability Edition instance after Use the log backup feature is enabled for the instance.
    Sandbox Instance Configurations Specifications The specifications of the sandbox instance that you want to create. The following specifications are supported:
    • 1 CPU core and 1 GB of memory
    • 1 CPU core and 2 GB of memory
    • 2 CPU cores and 4 GB of memory
    • 2 CPU cores and 8 GB of memory
    • 4 CPU cores and 8 GB of memory
    • 4 CPU cores and 16 GB of memory
    • 8 CPU cores and 16 GB of memory
    • 8 CPU cores and 32 GB of memory

    The restoration speed does not vary with the specifications of sandbox instances. However, sandbox instances with higher specifications provide better performance. For more information, see Sandbox instance fees.

    Region The region in which the sandbox instance resides.
    Peer VPC The virtual private cloud (VPC) in which you want to deploy the sandbox instance.

    If you want to connect to the sandbox instance by using your Elastic Compute Service (ECS) instances, you must set this parameter to the VPC in which the ECS instances reside. For information about how to create a VPC, see Default VPCs and default vSwitches.

    Peer vSwitch The vSwitch to which you want to connect the sandbox instance. The sandbox instance can be accessed by using the CIDR block specified for the vSwitch.
    Database Account Type The following options are supported:
    • Use Original Database Account: The account of the source database is used as the account of the sandbox instance.
    • Create Privileged Account: You create a privileged account for the sandbox instance. The privileged account has permissions on all databases in the sandbox instance. You must enter a new database account and a password. The account of the source database is retained in the sandbox instance.
      Note A privileged account is created only in the current sandbox instance.

      If the account name of the source database is the same as the name of the privileged account, the account of the source database is overwritten by the privileged account in the sandbox instance.

  6. Click OK.
    DBS performs a precheck and creates the sandbox instance. When the state of the sandbox instance changes to Running, you can connect to the sandbox instance.

    The account, the password, and all configurations of the sandbox instance are consistent with those of the source database. If you select Create Privileged Account in Step 5, you can also use the privileged account that is created to connect to the sandbox instance.

    View the sandbox instance

What to do next

You can obtain the endpoint of the sandbox instance in the ApsaraDB RDS console and connect to the endpoint by using the corresponding client. You can also connect to the sandbox instance by using Data Management (DMS) or ECS. For more information, see Use DMS to access sandbox instances or Use ECS to access sandbox instances.

Note The client, such as an ECS instance, that you use to connect to the sandbox instance must be deployed in the same VPC as the sandbox instance.