This topic describes how to back up an ApsaraDB RDS for PostgreSQL instance. You can configure a backup policy based on which ApsaraDB RDS automatically backs up your RDS instance. If you do not configure a backup policy, the default backup policy is used. You can also manually back up your RDS instance.
- Back up an ApsaraDB RDS for MySQL instance
- Back up an ApsaraDB RDS for SQL Server instance
- Back up an ApsaraDB RDS for MariaDB instance
Prerequisites
The AliyunServiceRoleForDBS service-linked role is created by using your Alibaba Cloud account. For more information, see How do I create a service-linked role for DBS?
Usage notes
- Do not execute DDL statements during a backup. These statements trigger locks on tables, and the backup may fail as a result of the locks.
- We recommend that you back up your RDS instance during off-peak hours.
- If your RDS instance has a large amount of data, a backup may require a long period of time.
- 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.
Billing rules
If the backup storage of your RDS instance does not exceed the free quota on backup storage, you are not charged for backup storage. If the backup storage exceeds the free quota, you are charged for the excess storage that you use. For more information about the free backup quota and backup storage pricing of an RDS instance, see Billable items and pricing for the backup storage of an ApsaraDB RDS for PostgreSQL instance.
Overview of data backups and log backups
Database engine | Data backup | Log backup |
---|---|---|
PostgreSQL | Data backups are copies of the data of your RDS instance. Physical backups and snapshot backups are supported. You can use these backups to restore the data of your RDS instance. For more information, see Restore the data of an ApsaraDB RDS for PostgreSQL instance. The system automatically performs physical backups or snapshot backups on your RDS instance based on the storage type of the instance.
Note You can download full physical backup files and snapshot backup files. For more information, see Download the backup files of an ApsaraDB RDS for PostgreSQL instance. | Log backups are copies of the archived log files of your RDS instance. Note If your RDS instance runs RDS Basic Edition, log backups are not supported. |
Configure automatic backup
After you configure a backup policy for an RDS instance, ApsaraDB RDS automatically backs up the RDS instance based on the backup policy.
- 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.
- In the left-side navigation pane, click Backup and Restoration.
- On the Backup Settings tab of the Backup and Restoration page, click Edit in the Data Backup Settings section.
- Configure the following parameters and click Save.
Table 1. Data backup settings Instance category Parameter Description RDS instances that cloud disks Snapshot Backup Period The cycle based on which you want to perform a backup. You can select one or more days of the week.
Note For data security purposes, we recommend that you select at least two days of the week.Single-digit Second Backup Specifies whether to enable the single-digit second backup feature. If you enable this feature, the system completes each backup in 1 second.
Note- If you enable this feature, the system performs a single-digit second backup on the RDS instance based on the backup period and backup time that you specified.
- If you enable this feature, each manual backup is performed as a single-digit second backup. For more information, see Manually back up an RDS instance.
- The retention period of backup files that are generated by the single-digit second backup feature is fixed as seven days.
Snapshot Backup Start Time The period of time during which a data backup operation is performed. For example, you can set this parameter to 06:00-07:00. We recommend that you select an off-peak hour.
Increase Snapshot Frequency The frequency at which snapshot backups are created. This feature enables you to configure a shorter interval to create snapshots by using the single-digit second backup feature, which increases the frequency of snapshots. 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 at the minute granularity: All snapshots that are completed within 1 hour are retained. For snapshots that are generated 1 hour ago, the system deletes the snapshots except for the first snapshot that is generated after the hour. For snapshots that are generated 24 hours ago, the system deletes the snapshots except for the first snapshot that is generated after 00:00 every day.
- A value at the hour granularity: All snapshots that are completed within 24 hours are retained. For snapshots that are generated 24 hours ago, 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.Snapshot Backup Retention (Days) The number of days for which you want to retain data backup files. Valid values: 7 to 730. Default value: 7.
Note This parameter takes effect only for data backup files that are generated from standard backups. This parameter does not take effect for data backup files that are generated from single-digit second backups.RDS instances that use local disks Data Retention Period (Days) The number of days for which you want to retain data backup files. Valid values: 7 to 730. Default value: 7.
Backup Cycle The cycle based on which you want to perform a backup. You can select one or more days of the week.
Note For data security purposes, we recommend that you select at least two days of the week.Backup Time The period of time during which a data backup operation is performed. For example, you can set this parameter to 06:00-07:00. We recommend that you select an off-peak hour.
Table 2. Log backup settings Parameter Description Log Backup Specifies whether to enable the log backup feature. After this feature is enabled, you can restore the data of your RDS instance to a specified point in time.
Important If you disable this feature, all log backup files are deleted and you cannot restore the data of the RDS instance to a specified point in time.Log Retention Period (Days) - The number of days for which you want to retain log backup files. Valid values: 7 to 730. Default value: 7.
- The log backup retention period must be shorter than or equal to the data backup retention period.
Manually back up an RDS instance
- 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.
- In the upper-right corner of the page, click Backup Instance. In the dialog box that appears, configure the parameters and click OK.
- Optional. In the upper-right corner of the page, click the
icon. On the Task Center page, set the Task Type parameter to Manual Backup to view the progress of the backup task.
Note After the backup task is complete, you can download the backup file on the Backup and Restoration page. Some RDS instances do not support the download of backup files. These RDS instances include RDS instances that use cloud disks. For more information, see Download the backup files of an ApsaraDB RDS for PostgreSQL instance.
FAQ
- Can I disable the data backup feature for my RDS instance?
No, you cannot disable the log backup feature for your RDS instance. You can reduce the backup frequency to at least twice a week.
- Can I disable the log backup feature for my RDS instance?
Yes, you can disable the log backup feature for your RDS instance. To disable the feature, log on to the ApsaraDB RDS console, go to the Backup Settings tab of your RDS instance, and then modify the backup settings.
Related operations
Operation | Description |
---|---|
Create a backup file | Creates data backup files for an instance. |
Query the data backup files | Queries the data backup files of an instance. |
Query backup settings | Queries the backup settings of an instance. |
Modify backup settings | Modifies the backup settings of an instance. |
Delete backup sets | Deletes the data backup files of an instance. |
Query backup tasks | Queries the backup tasks of an instance. |
Query log backup files | Queries the binary log files of an instance. |