This topic describes the binary log files and log backup files of an ApsaraDB RDS for MySQL instance.

Overview

  • Binary log files are used to subscribe to data and build a primary/secondary architecture. The binary logging feature is enabled by default and cannot be disabled.
  • Log backup files can be used to restore data to a specific point in time within the backup retention period that you specify.

Binary log files

Binary log files are generated on RDS instances in real time. The rules based on which binary log files are generated varies based on the RDS edition of your RDS instance:
  • RDS Basic Edition or RDS High-availability Edition: When the size of a binary log file reaches 512 MB or the amount of time during which binary log data continues to be written to a binary log file exceeds 6 hours, a new binary log file is generated.
  • RDS Enterprise Edition: When the size of a binary log file reaches 512 MB, a new binary log file is generated.

The binary logging feature is provided free of charge. However, binary log files consume the storage capacity of your RDS instance.

Operations:
  • View binary log files: You cannot view binary log files in the ApsaraDB RDS console. To view binary log files, you must execute the SHOW BINARY LOGS; statement. For more information, see ApsaraDB RDS for MySQL remotely obtains and parses binary log files.
  • View the total size of binary log files:
    1. Visit the RDS instance list, select a region above, and click the target instance ID.
    2. Log on to the ApsaraDB RDS console, find your RDS instance, and then click the instance ID. In the left-side navigation pane, click Monitoring and Alerts. On the Standard Monitoring tab of the page that appears, view the total size of binary log files.
      Note By default, the total size of binary log files on the primary RDS instance is the same as the size of binary log files on the secondary RDS instance. The sizes may differ due to the following reasons: The primary RDS instance replicates data to the secondary RDS instance at a specific latency, the binary log files are dumped at a specific latency, Data Transmission Service (DTS) is migrating data from or to the primary RDS instance, or the secondary RDS instance is reading and applying binary log records.
  • Delete binary log files: For more information, see Delete the binary log files of an ApsaraDB RDS for MySQL instance.

Log backup files

ApsaraDB RDS supports data backups and log backups. If you enable the log backup feature for your RDS instance, the binary log files of your RDS instance are uploaded to dedicated backup storage in real time. The binary log files in the dedicated backup storage are called log backup files. You can use log backup files to restore data to a specific point in time within the backup retention period that you specify.

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

Pricing: The log backup feature is provided free of charge, and a free quota for backup storage is provided. If the total size of the data backup files and log backup files of your RDS instance exceeds the free quota, you are charged for your excess backup storage.

Operations:
  • Enable or disable the log backup feature:
    1. Visit the RDS instance list, select a region above, and click the target instance ID.
    2. In the left-side navigation pane, click Backup and Restoration.
    3. Click the Backup Settings tab. In the Local Log Backup Settings section of the tab that appears, click Edit.
    4. Enable or disable the log backup feature. You can also specify the log backup retention period.
      Note If your RDS instance runs MySQL 5.7 on RDS Basic Edition, you cannot disable the log backup feature for your RDS instance and the log backup retention period is fixed as seven days.
  • View log backup files:
    1. Visit the RDS instance list, select a region above, and click the target instance ID.
    2. In the left-side navigation pane, click Backup and Restoration.
    3. Click the Log Backup tab.

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

  • View the total size of log backup files:
    1. Visit the RDS instance list, select a region above, and click the target instance ID.
    2. In the lower-right corner of the Basic Information page, view the total size of log backup files. Total size of log backup files
      Note Log backup files are stored in dedicated backup storage and do not consume the storage capacity of your RDS instance.
  • Delete log backup files. For more information, see Delete the backup files or reduce the backup frequency of an ApsaraDB RDS for MySQL instance.
  • Download log backup files. For more information, see Download the backup files of an ApsaraDB RDS for MySQL instance.
  • Restore data to a specific point in time. For more information, see Restore the data of an ApsaraDB RDS for MySQL instance or Restore the individual databases and tables of an ApsaraDB RDS for MySQL instance.

FAQ

FAQ about how to view log backup files
  1. Why are no log backup files displayed on the Log Backup tab of my RDS instance?
    This issue occurs due to one of the following reasons:
    • The log backup feature is not enabled for your RDS instance.
    • Your RDS instance is recently 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.
  2. Why is the most recent log backup file not displayed on the Log Backup tab?

    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.

  3. If I set the log backup retention period to seven days, can I obtain log backup files that are generated seven days ago?

    No, if you set the log backup retention period to seven days, you cannot obtain log backup files that are generated seven days ago. ApsaraDB RDS 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.

FAQ about how to disable the log backup feature and delete log backup files
  1. How do I delete log backup files after I disable the log backup feature?

    You do not need to delete log backup files. ApsaraDB RDS automatically deletes log backup files immediately after you disable the log backup feature.

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

  3. Why is no storage released after I disable the log backup feature?

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

  4. Why does the size of log backup files suddenly increase?

    If you frequently perform add, delete, and update operations on the data in your RDS instance, the size of log backup files increases. For more information about how to delete log backup files, see Delete the backup files or reduce the backup frequency of an ApsaraDB RDS for MySQL instance.