All Products
Search
Document Center

ApsaraDB RDS:Use the log backup feature for an ApsaraDB RDS for MySQL instance

Last Updated:Feb 27, 2024

After you enable the log backup feature for your RDS instance, the binary log files of your RDS instance are uploaded to backup storage in real time. The binary log files in the backup storage are called log backup files. You can use log backup files to restore the data of your RDS instance to a specific point in time within the backup retention period that you specified. This topic describes how to manage and view the log backup files of an ApsaraDB RDS for MySQL instance.

Billing rules

You are not charged for the feature. However, log backup files consume backup storage, and you are charged for the backup storage that is consumed. A free quota on backup storage is provided. If the total size of data backup files and log backup files exceeds the free quota, you are charged additional fees for the excess backup storage that you use. For more information, see Backup storage fees.

Enable or disable the log backup feature

  1. Go to the Instances page. In the top navigation bar, select the region in which the RDS instance resides. Then, find the RDS instance and click the ID of the instance.
  2. In the left-side navigation pane, click Backup and Restoration.

  3. On the Backup and Restoration page that appears, click the Backup Strategy tab.

  4. In the Basic Backup section, click Edit to enable or disable the log backup feature.

    Log Backup Settings (Log Backup regular Edition)

    Parameter

    Description

    Log Backup

    Specifies whether to enable the log backup feature. After the feature is enabled, you can restore the data of your RDS instance to a point in time. This feature is enabled by default.

    Log Backup Retention Period (Days)

    • The valid value ranges from 7 to 730. Default value: 7.

    • The log backup retention period must be less than or equal to the data backup retention period.

    Note

    If your RDS instance runs MySQL 5.7 on RDS Basic Edition, the value is fixed as 7.

    Configure the PITR feature (enhancement of the log backup feature)

    The PITR feature is supported for RDS instances that reside in specific regions. For more information about the differences between the PITR and log backup features, the description of the PITR feature, and the RDS instances for which the PITR feature can be enabled, see Configure the PITR feature.

    Important

    To implement PITR, the system retains additional backup sets based on the value of the Time Range of Specific Points in Time for Restoration parameter.

    For example, if you set the Time Range of Specific Points in Time for Restoration parameter to 7, the system retains the backup sets for 7 to 9 days. The system retains an additional full backup for more than seven days and all consecutive log backups generated from the seventh day to the day in which the last full backup is generated. You are charged for the storage of one full backup and additional log backups that are generated within one week at most.

    Parameter

    Description

    Restoration to Specific Point in Time

    Specifies whether to enable the PITR feature. After the feature is enabled, you can restore the data of your RDS instance to any point in time. The feature is an enhancement of the log backup feature. By default, Time Range of Specific Points in Time for Restoration is turned on for new RDS instances.

    Time Range of Specific Points in Time for Restoration

    The number of days during which you can restore data of your RDS instance to any point in time. If the value of this parameter is modified, the retention period of log backups is also modified.

    • Valid values: 7 to 730. Default value: 7.

    • The value must be less than or equal to the retention period of full backups.

    Note

    If your RDS instance runs MySQL 5.7 on RDS Basic Edition, the value is fixed as 7.

    Important

    After you disable the log backup feature, the system automatically deletes existing log backup files within 1 to 3 minutes. Deleted log backup files cannot be restored. Proceed with caution.

View log backup files

  1. Go to the Instances page. In the top navigation bar, select the region in which the RDS instance resides. Then, find the RDS instance and click the ID of the instance.
  2. In the left-side navigation pane, click Backup and Restoration.

  3. On the page that appears, click Base Backups and then Log Backup.Backup and Restoration

    If your RDS instance runs RDS High-availability Edition or RDS Enterprise Edition, log backup files are generated by your primary RDS instance and its secondary RDS instances. You can check the instance ID of each log backup file to identify the log backup files that are generated by your primary RDS instance and the log backup files that are generated by the secondary RDS instances.

View the total size of log backup files

  1. Go to the Instances page. In the top navigation bar, select the region in which the RDS instance resides. Then, find the RDS instance and click the ID of the instance.
  2. On the Basic Information page of the RDS instance, view the total size of log backup files in the Usage Statistics section.

    image.png

    Note
    • Log backup files are stored in the backup storage and do not consume the storage capacity of your RDS instance. The backup storage is inaccessible.

    • After you update the minor engine version of your RDS instance, the value of the Backup Usage parameter on the Basic Information page of the RDS instance may be displayed as 0. After the next scheduled backup is complete, this error is automatically fixed.

Delete log backup files

For more information, see Delete backup files or reduce the size of backup files.

Download log backup files

For more information, see Download backup files.

Restore data to a specific point in time

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

FAQ

Category

Description

Data restoration

Can I use log backup files to restore data?

After the log backup feature is enabled, you can restore data to a specific point in time within the backup retention period that you specified. The point in time can be accurate to seconds. For more information, see Restore full data and Restore individual databases and tables of an ApsaraDB RDS for MySQL instance.

Backup fee

Am I charged for the log backup feature?

No, you are not charged for the feature. However, log backup files consume backup storage, and you are charged for the backup storage that is consumed. A free quota on backup storage is provided. If the total size of data backup files and log backup files exceeds the free quota, you are charged additional fees for the excess backup storage that you use. For more information, see Backup storage fees.

Backup file check

  • No log backup files are displayed on the Log Backup tab of my RDS instance. Why?

    This issue occurs due to one of the following reasons:

    • The log backup feature is disabled for your RDS instance. For more information about how to enable the log backup feature, see Enable or disable the log backup feature.

    • Your RDS instance is newly created, or the log backup feature is recently enabled for your RDS instance. In this case, log backup files have not been uploaded to the backup storage, and no log backup files are displayed on the Log Backup tab.

  • The most recent log backup file is not displayed on the Log Backup tab. Why?

    Only the log backup files to which no new data is written are displayed on the Log Backup tab. Log backup files to which data is being written are not uploaded to the backup storage.

  • If I set the log backup retention period to seven days, can I obtain log backup files that are generated seven days before the current date?

    No, you cannot obtain log backup files that are generated seven days before the current date in this case. The system automatically deletes the log backup files that are stored for a longer period of time than the specified log backup retention period. We recommend that you specify a log backup retention period based on your business requirements.

Disabling of the feature and reduction of log backups

  • How do I delete log backup files after I disable the log backup feature?

    After you disable the log backup feature, the system automatically deletes existing log backup files within 1 to 3 minutes. Deleted log backup files cannot be restored. Proceed with caution.

  • Why am I still able to query log backup files by executing the SHOW BINARY LOGS; statement after I disable the log backup feature?

    The files that you query by executing this statement are binary log files rather than log backup files. For more information about how to delete binary log files, see Delete the binary log files of an ApsaraDB RDS for MySQL instance.

  • No storage is released after I disable the log backup feature. Why?

    Log backup files do not consume the storage capacity of your RDS instance. Binary log files consume the storage capacity of your RDS instance.

  • Why does the size of log backup files suddenly increase?

    If you frequently add data, modify data, or delete data on your RDS instance, the size of log backup files increases. For more information about how to delete log backup files, see Delete backup files or reduce the size of backup files.

Related operations

  • You can call the DescribeBackupPolicy operation to view the backup settings of an instance. For more information, see DescribeBackupPolicy.

  • You can call the ModifyBackupPolicy operation to modify the backup settings of an instance. For more information, see ModifyBackupPolicy.