ApsaraDB RDS for MySQL log backup

更新时间:
复制 MD 格式

After you enable log backup, binary logs are uploaded to backup storage in real time to create log backups, which let you restore data to any point in time within the backup retention period. This topic describes how to manage and view log backups for ApsaraDB RDS for MySQL.

Billing

Enabling log backup is free. However, log backups consume backup storage, and you are charged for the storage space that they use. Backup storage comes with a free quota. When the total size of data backups and log backups exceeds the free quota, you are charged backup fees.

Enable or disable log backup

  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, click the Backup Strategy tab.

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

    Standard log backup

    Parameter

    Description

    Log Backup

    Enables point-in-time recovery. This feature is enabled by default.

    Log Backup Retention Period (Days)

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

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

    Note

    For ApsaraDB RDS for MySQL 5.7 instances on the Basic Edition, the value is fixed at 7 days.

    Enhanced point-in-time recovery

    This setting is available only for ApsaraDB RDS for MySQL instances in select regions. For information about the differences between PITR and log backup, how PITR works, and the instance requirements, see Configure a point-in-time recovery policy.

    Important

    To support PITR, the instance retains some backup sets beyond the configured Log Backup Retention Period (Days).

    For example, if you set the Log Backup Retention Period (Days) to 7 days, the backup data is retained for 7 to 9 days. Specifically, the system retains the most recent full backup that is older than 7 days, and all subsequent log backups from that full backup through the end of the 7-day period. You are charged for only one full backup and up to one extra week of log backups.

    Parameter

    Description

    Log Backup

    Enables the backup of transaction logs, which is required for point-in-time recovery. This feature is enabled by default.

    Point-in-time recovery

    Enables data recovery to a specific point in time (PITR).

    Log Backup Retention Period (Days)

    Specifies the retention period for log backups.

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

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

    Note

    For RDS Basic Edition instances that run MySQL 5.7, the value is fixed at 7 days.

    Important

    After you disable log backup, the system automatically deletes the existing log backup sets within 1 to 3 minutes. The deleted log backup sets cannot be recovered. Proceed with caution.

View log backups

  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, click Base Backups > Log Backup.

    For High-availability Edition instances, both the primary and secondary nodes generate log backups. In the backup list, they are distinguished by File Location Instance ID.

View log backup size

  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 instance, you can view the log backup size in the Instance Resources section.

    Note
    • Log backups are stored in backup storage and do not consume the storage space of your instance. Backup storage is not publicly accessible.

    • After a minor version upgrade for an ApsaraDB RDS for MySQL instance of the Basic Edition, the Basic Information on the Backup Usage page may display as 0. The value is automatically restored after the next scheduled backup is complete.

Delete log backups

See Delete or reduce backups.

Download log backups

See Download backups.

Point-in-time recovery

Enabling log backup allows you to restore data to a specific point in time. For instructions, see Restore full data or Restore databases and tables.

FAQ

Category

Details

Restore data

Q: Can log backups be used to restore data?

A: Yes. After you enable log backup, you can restore data to any point in time (to the second) within the backup retention period. For more information, see Restore full data or Restore databases and tables.

Backup costs

Q: Are log backups free?

A: Enabling log backup is free. However, log backups consume backup storage, and you are charged for the storage space that they use. Backup storage comes with a free quota. When the total size of data backups and log backups exceeds the free quota, you are charged backup fees.

View backups

  • Q: Why is the log backup page empty?

    A: The log backup page can be empty for the following reasons:

    • Log backup is not enabled. To enable it, see Enable or disable log backup.

    • You have just created the instance or enabled log backup, and the binary logs have not yet been uploaded to backup storage.

  • Q: Why can't I see the latest logs on the log backup page?

    A: The system has not yet uploaded log files that are being written.

  • Q: My log backups are retained for only 7 days. Is it possible to obtain logs that are older than 7 days?

    A: Backups that exceed the retention period are deleted automatically. We recommend that you set an appropriate retention period.

Disable or reduce backups

  • Q: After I disable log backup, how do I delete the log backups?

    A: After you disable log backup, the system automatically deletes the existing log backup sets within 1 to 3 minutes. The deleted log backup sets cannot be recovered. Proceed with caution.

  • Q: Why did my log backup size suddenly increase?

    A: Frequent INSERT, UPDATE, and DELETE operations increase the log volume. To delete log backups, see Delete or reduce backups.

  • Q: I don't need log backups. I only want to keep the binary logs on the instance. What should I do?

    A: You can disable log backup and then set the retention period for binary logs as needed. For more information about how to set the retention period for binary logs, see Set a local log policy.

  • Q: After I disable log backup, why can I still find log files by running the SHOW BINARY LOGS; command?

    A: This command queries binary logs on the instance, not log backups. To delete binary logs, see Delete binary log files.

  • Q: After I disable log backup, why is the storage space not released?

    A: Log backups do not occupy instance storage space, but binary logs do.

Related documents

API reference