Database Backup (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.

Billing

  • 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 to be restored to the sandbox storage and generates multiple snapshots for the backup data. The snapshots are stored in the sandbox storage and can be directly used to create sandbox instances. DBS charges you sandbox storage fees based on the volume of the data stored in the sandbox storage. For more information, see Sandbox storage fees.
  • After you create a sandbox instance for emergency disaster recovery, DBS charges you sandbox instance fees based on the specifications and usage duration of the sandbox instance. If you have not created sandbox instances for emergency disaster recovery, you are not charged sandbox instance fees. 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 automatic backups for an ApsaraDB RDS for MySQL instance.
  • The RDS instance resides in one of the following regions: China (Beijing), China (Shanghai), China (Hangzhou), China (Shenzhen), China (Zhangjiakou), China (Chengdu), China (Hohhot), China (Ulanqab), China (Heyuan), China (Hong Kong), Indonesia (Jakarta), Malaysia (Kuala Lumpur), Australia (Sydney), Germany (Frankfurt), China East 1 Finance, Japan (Tokyo), US (Silicon Valley), Singapore (Singapore), US (Virginia), and India (Mumbai).
  • 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.

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. Visit the RDS instance list, select a region above, and click the target instance ID.
  2. In the left-side navigation pane, click Backup and Restoration.
  3. On the Backup and Restoration page, click the Crash Recovery tab.
    Crash recovery
  4. Click Enable DBS Sandbox.
  5. In the Set Sandbox Policy dialog box, configure the parameters.
    • Sandbox Feature: Turn on the Sandbox Feature switch to enable the sandbox feature.
    • Storage Type: the storage type of the sandbox. You need to pay for only 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. Visit the RDS instance list, select a region above, and click the target instance ID.
  2. In the left-side navigation pane, click Backup and Restoration.
  3. On the Backup and Restoration page, click the Crash Recovery tab.
    Crash recovery
  4. Click Recover Sandbox Instance.
  5. In the Recover Sandbox Instance dialog box, configure the parameters that are described in the following table.
    Recover a sandbox instance
    Type Configuration item Description
    Sandbox Instance Point in Time Sandbox Data Time Range The time range available to restore the source database. The value of this parameter depends on the value of the Sandbox Data Retention Period parameter that you specify for the sandbox feature. If the Sandbox Data Retention Period parameter is set to 7, the available time range is the last seven days.
    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.
    Sandbox Instance Configurations Specifications The specifications of the sandbox instance that you want to create. The following specifications are supported:
    • 1 core and 1 GB of memory
    • 1 core and 2 GB of memory
    • 2 cores and 4 GB of memory
    • 2 cores and 8 GB of memory
    • 4 cores and 8 GB of memory
    • 4 cores and 16 GB of memory
    • 8 cores and 16 GB of memory
    • 8 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 where the sandbox instance resides.
    Peer VPC The virtual private cloud (VPC) within which to create 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 where the ECS instances reside. For more information about how to create a VPC, see Default VPC and default vSwitch.

    Peer vSwitch The vSwitch to which to connect to the sandbox instance. The sandbox instance can be accessed by using the CIDR block specified for the vSwitch.
    Database Account Type The type of the account that is used to connect to the sandbox instance. Valid values:
    • Use Original Database Account: Use the account of the source database.
    • Create Privileged Account: Create a privileged account in the sandbox instance. The privileged account has permissions on all databases in the 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 about DMS and ECS, see Use DMS to access sandbox instances and 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 within the same VPC as the sandbox instance.