Database Backup (DBS) provides the sandbox feature to allow you to create sandbox instances based on backup sets and restore data in a quick manner. Read and write operations that are performed in each sandbox instance do not affect data in other sandbox instance or source databases. This topic describes how to create a sandbox instance and use the sandbox instance to restore data.

Prerequisites

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

Background information

The sandbox feature is integrated with the data deduplication feature and storage virtualization feature to help reduce storage costs and overall costs for data backup. The data deduplication feature and incremental data merge feature ensure that full backup data is available for the server. The storage virtualization feature can provide replicas of full backup data for read and write operations without the need to copy data. For more information about the features, common scenarios, pricing, and limits of sandbox instances, see Overview.

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

To use the sandbox feature, perform the following steps:

Pricing

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

Enable the sandbox feature

After you enable the sandbox feature, DBS automatically synchronizes the data that are backed up to the sandbox storage and generates multiple snapshots for the data. The snapshots are stored in the sandbox storage and can be used to create sandbox instances.

  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, configure the parameters.

    Retention days: the number of days for which DBS retains data. You can use the retained data to create sandbox instances. Default value: 7. By default, DBS retains the data that is stored in the most recent seven days. If you set this parameter to 0, the system retains only the most recent data snapshot.

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

    After information about a specific time range is displayed as the value of the Sandbox instance time range parameter, you can create a sandbox instance to restore data to a specified point in time in the time range. The following table describes the values of the Sandbox instance time range parameter.

    Sandbox status 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 and the end time of the most recent backup.

Disable 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. Find the backup schedule for which you want to disable the sandbox feature and click Release sandbox in the Sandbox function column.
  4. In the Set sandbox function dialog box that appears, turn off Sandbox function.
  5. Click OK.
    Note After you click OK, a message may appear if the system fails to disable the sandbox feature. Follow the instructions in the message to complete the required operations and then try again. For information about error messages and troubleshooting methods, see FAQ.

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, configure the parameters. The following table describes the parameters.
    Create a sandbox instance
    Section Parameter Description
    N/A Task Name The name of the task. DBS automatically generates a task name. We recommend that you specify a name that can help you identify the task. Task names do not need to be unique.
    Restore Time Time Range Available to Restore The time range in which available backup sets are created.
    Restore To The point in time to which you want to restore data. 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 data to a random point in time in the time range that is specified by the Time Range Available to Restore parameter.
    • If the incremental backup feature is disabled, you can restore data only to a point in time when a full backup set was created.
    Sandbox instance information settings DB InstanceClass 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 specifications of the sandbox instance do not significantly affect the period of time that the system requires to restore data. A sandbox instance with higher specifications provides better performance. For more information, see Sandbox instance fees.

    Instance Region The region where you want to deploy the sandbox instance.
    Peer VPC The ID of the VPC in which you want to deploy the sandbox instance.

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

    Peer VSwitch The ID of the vSwitch to which you want to connect the sandbox instance. The sandbox instance can be accessed from the CIDR blocks that are specified for the vSwitch.
  6. Click Recover immediately.
    DBS checks the configurations of the sandbox instance and navigates to the Sandbox tasks page. On the Sandbox tasks page, you can view the progress of the sandbox instance creation task. 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 the same as the configurations of the source database.

    View the details of the sandbox instance

Access the sandbox instance

You can obtain the endpoint of the sandbox instance in the DBS console and configure the endpoint in your DBS client to access the sandbox instance. 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 that are performed in the sandbox instance do not change data in the source database. You can perform various operations in the sandbox instance such as analysis, testing, verification, and emergency disaster recovery.
Note
  • The server of your client, such as an ECS instance, must be deployed in the same VPC in which the sandbox instance is deployed.
  • The username, password, and all other configurations of the sandbox instance must be the same as the configurations of the source database.

Release 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. In the left-side navigation pane, click Sandbox tasks. On the page that appears, find the sandbox instance that you want to release and click Release Instance in the Actions column.
  5. Click OK.

FAQ

Question: After I disable the sandbox feature, does DBS still charges me for sandbox resources?

Answer: After you release all sandbox instances and disable the sandbox feature, DBS does not charge you for sandbox resources.