The sandbox feature that is provided by Database Backup (DBS) allows you to create databases from backup sets in a short period of time. Read and write operations are performed within each sandbox instance and do not affect source databases. Sandbox instances are isolated from each other. This topic describes how to create and use DBS sandbox instances.

Prerequisites

  • The data source is a self-managed MySQL database. For more information about how to connect to a data source, see Add a data source.
  • A backup schedule is created, and at least one full backup is complete. For more information, see Back up one or more databases.
  • The backup schedule is in the Running state.
  • A virtual private cloud (VPC) is created for connecting to sandbox instances. For more information, see Default VPC and default vSwitch.

Background information

The DBS sandbox feature uses data deduplication and storage virtualization to resolve the issues of increasing storage and use costs of traditional database backup services. Data deduplication and incremental merge allow you to keep full backup data available on the server. Storage virtualization can provide replicas of full backup data for read and write operations without the need to copy data. For more information about the benefits, scenarios, billing, and limits of the sandbox feature, see Overview.

This topic describes the emergency disaster recovery of a self-managed database. For more information about the emergency disaster recovery of an ApsaraDB RDS database, see Create a sandbox instance for the emergency disaster recovery of an ApsaraDB RDS for MySQL database.

To use the DBS sandbox feature, perform the following steps:
  1. Enable the sandbox feature

    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.

  2. Create a sandbox instance
  3. Connect to the sandbox instance

    You can obtain the endpoint of the sandbox instance in the DBS 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 Elastic Compute Service (ECS). For more information, see Use DMS to access sandbox instances or Use ECS to access sandbox instances. Read and write operations performed within sandbox instances do not affect source databases. You can perform various operations in sandbox instances, such as analysis, testing, verification, and emergency disaster recovery.

Billing

  • 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.

Enable the sandbox feature

  1. Log on to the DBS console.
  2. In the left-side navigation pane, click Backup Schedules. On the Backup Schedules page, select a region in the upper-left corner.
  3. On the Backup Schedules page, click Manage in the Actions column corresponding to a backup schedule.
  4. On the Configure Task page, click Set sandbox function in the Sandbox information section.
  5. In the Set sandbox function dialog box, turn on Sandbox function and set the required parameters.
    Set sandbox function
    • Pay mode: the billing method of the sandbox feature. Only Commercial Capacity Edition is supported. For more information, see DBS sandbox fees.
    • Retention days: 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. If you set this parameter to 0, only the latest snapshot is retained.
  6. Click OK.
    After you enable the sandbox feature, the Sandbox instance time range parameter is set to Data preparing. If the sandbox feature is enabled 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. You must wait for the preparation process to complete. The wait time varies based on the backup data size and may take 5 to 20 minutes. Sandbox data being prepared

    After the available time range is displayed to the right of the Sandbox instance time range parameter, you can create sandbox instances. The following table describes the values of the Sandbox instance time range parameter.

    Sandbox status Description
    Sandbox feature disabled The Sandbox instance time range parameter is automatically set to Unopened.
    Preparation after you enable the sandbox feature The Sandbox instance time range parameter is automatically set to Data preparing.
    Preparation completed The Sandbox instance time range parameter is automatically set to a time range during which sandbox instances can be created.
    Note The displayed time range is within the start time of the earliest backup set and the end time of the latest backup set.

Create a sandbox instance

  1. Log on to the DBS console.
  2. In the left-side navigation pane, click Backup Schedules. On the Backup Schedules page, select a region in the upper-left corner.
  3. On the Backup Schedules page, click Manage in the Actions column corresponding to a backup schedule.
  4. On the Configure Task page, click Create a sandbox instance in the upper-right corner.
  5. On the Create a sandbox instance task page, set the parameters that are described in the following table.
    Create a sandbox instance task
    Section Parameter Description
    N/A Task Name The name of the restore task. DBS generates a task name. We recommend that you set a descriptive name that is easy to identify. Task names do not have to be unique.
    Restore Time Time Range Available to Restore The time range available to restore the source database. DBS displays the available time range.
    Restore To The point in time to which you want to restore the source database. The value must be within the time range that is specified by the Time Range Available to Restore parameter.
    Note
    • If the incremental backup feature is enabled, you can restore the data to a specific point in time within the time range that is specified by the Time Range Available to Restore parameter.
    • If the incremental backup feature is disabled, you can restore the data only to a point in time when a full backup is complete. For more information about how to enable the incremental backup feature, see Manage backup schedules.
    Sandbox instance information settings DB InstanceClass The specifications of the sandbox instance to be created. 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 32 GB of memory

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

    Instance Region The region where the sandbox instance is deployed.
    Peer VPC The virtual private cloud (VPC) within which the sandbox instance is created.

    If you want to connect to the sandbox instance by using your ECS instance, you must set this parameter to the VPC where the ECS instance resides. For more information about how to create a VPC, see Default VPC and default vSwitch.

    Peer vSwitch The vSwitch to which the sandbox instance is connected. The sandbox instance can be accessed by using the CIDR block specified for the vSwitch.
  6. Click Recover immediately.
    DBS performs a precheck and goes to the Sandbox tasks tab. On this page, you can view the progress of emergency disaster recovery. When the status of the sandbox instance changes to Running, you can connect to the sandbox instance.

    The username, password, and all other configurations of the sandbox instance must be consistent with those of the source database.

    View the sandbox instance

What to do next

You can obtain the endpoint of the sandbox instance in the DBS console and connect to the endpoint by using the corresponding client. You can also connect to the sandbox instance by using 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.
  • The username, password, and all other configurations of the sandbox instance must be consistent with those of the source database.