All Products
Search
Document Center

ApsaraDB for MyBase:Enable automatic backup for an ApsaraDB MyBase for MySQL instance

Last Updated:Jul 14, 2023

If data in an instance is lost or corrupted, you can restore the data by using the backups. ApsaraDB MyBase for MySQL supports the automatic backup feature and the manual backup feature. This topic describes the automatic backup feature of ApsaraDB MyBase for MySQL.

Precautions

  • Backup policies cannot be configured for read-only instances in ApsaraDB MyBase for MySQL.

  • Do not execute DDL statements during a backup operation. If DDL statements are executed during a backup operation, the relevant tables are locked and the backup operation fails.

  • We recommend that you back up the data of an ApsaraDB MyBase for MySQL instance during off-peak hours.

  • If the number of tables that are contained in a database exceeds 600,000, a backup operation cannot be performed. If a database contains a large number of tables, we recommend that you save the tables in different databases.

  • Backup files are retained for a specified period of time. Before the specified retention period elapses, we recommend that you download the backup files that you need to your computer.

Procedure

  1. Log on to the ApsaraDB for MyBase console.

  2. In the upper-left corner of the page, select a region.

  3. In the left-side navigation pane, choose Instances > MySQL.

  4. Find the instance that you want to manage and click Details in the Actions column.

  5. In the left-side navigation pane, click Backup and Restoration.

  6. On the Backup and Restoration page, click the Backup Settings tab and click Edit.

  7. Configure the parameters that are described in the following tables. Then, click Save.

    Note

    By default, Snapshot Backup is selected for an ApsaraDB MyBase for MySQL instance that uses enhanced SSDs (ESSDs) and Physical Backup is selected for an ApsaraDB MyBase for MySQL instance that uses local SSDs.

    Table 1. Data backup settings

    Instance category

    Parameter

    Description

    Instance that uses ESSDs or local SSDs

    Data Backup Retention (Days)/Retention Period

    The number of days for which you want to retain data backups. Default value: 7. The valid values vary based on different scenarios.

    • If your ApsaraDB MyBase for MySQL instance uses ESSDs, the valid values range from 7 to 730.

      Note

      If you enable the Single-digit Second Backup feature, the data backup retention period is set to seven days.

    • If your ApsaraDB MyBase for MySQL instance uses local SSDs, the valid values are greater than or equal to 7 and less than 2 to the power of 31.

      • Data backups that are retained for 730 days or less are considered regular backups.

      • Data backups that are retained for more than 730 days are considered archived backups.

      Note

      If you set this parameter to a value greater than 730 or you select Long-term Retention, the data backups that are retained for more than 730 days are automatically converted into archived backups. In this case, you must specify the number of archived backups that you want to retain. For example, if you select Monthly and enter 2 in the unit field, ApsaraDB for MyBase retains the first two archived backups that are generated each month.

    Backup Cycle

    The days on which data backup operations are performed. You must select at least two days of a week.

    Backup Time

    The time period during which a data backup operation is performed. For example, you can specify 05:00-06:00 for this parameter. We recommend that you specify an off-peak hour for this parameter.

    Instance that uses local SSDs

    Data Backup Retention Policy After Release

    The data backup retention policy after the instance is released. You can select None, Latest, or All for this parameter.

    Restore Individual Database/Table

    Specifies whether to enable the Restore Individual Database/Table feature. If the feature is enabled, you can restore data in your tables and databases. The feature is enabled by default and cannot be disabled.

    Restore Speed

    The speed at which data in your tables and databases is restored.

    For more information, see Restore individual databases and tables of an ApsaraDB RDS for MySQL instance.

    Instance that use ESSDs

    Increase Snapshot Frequency

    The frequency at which a snapshot backup operation is performed. This feature allows you to specify a high frequency at which a snapshot backup operation is performed when you use the Single-digit Second Backup feature. This increases the density of snapshots in a period of time. If you enable the Increase Snapshot Frequency feature, you can increase the frequency to up to once every 15 minutes.

    The snapshot retention policies vary based on the value of this parameter.

    • A value of minute granularity: All snapshots that are generated within 1 hour are retained. For snapshots that are generated for more than 1 hour, the system deletes the snapshots except for the first snapshot that is generated after each hour on the hour. For snapshots that are generated for more than 24 hours, the system deletes the snapshots except for the first snapshot that is generated after 00:00 each day.

    • A value of hour granularity: All snapshots that are generated within 24 hours are retained. For snapshots that are generated for more than 24 hours, the system deletes the snapshots except for the first snapshot that is generated after 00:00 each day.

    Note

    If you want to enable the Increase Snapshot Frequency feature, you must enable the Single-digit Second Backup feature. If the Single-digit Second Backup feature is disabled, the system automatically enables the Single-digit Second Backup feature when you enable the Increase Snapshot Frequency feature.

    Single-digit Second Backup

    Specifies whether to enable the Single-digit Second Backup feature. If the feature is enabled, a snapshot backup operation can be complete within a few seconds.

    Table 2. Log backup settings

    Parameter

    Description

    Log Backup

    If the Log Backup feature is enabled, you can restore the data of your ApsaraDB MyBase for MySQL instance to a specified point in time. By default, the Log Backup feature is enabled.

    Log Retention Period (Days)

    • The valid values of this parameter range from 7 to 730. Default value: 7. Unit: days.

    • The value of this parameter must be less than or equal to the value of the Data Backup Retention (Days) parameter.