OceanBase Database supports the creation of periodic backup strategies, allowing for full backups to be executed at specified intervals. It also supports initiating log backups and automatically cleaning up expired backup files.
Background information
By default, OceanBase Database uses the user business priority mode for log backup. In scenarios such as large-scale data import and backup media anomalies, when the log backup speed cannot keep up with the log generation speed, logs may be reclaimed, leading to log stream interruption. To ensure Point-in-Time Recovery (PITR), you need to perform data backup again. If you want to ensure PITR, you can contact OceanBase Technical Support to enable the archive priority log backup strategy or increase the log disk space to reduce the likelihood of log reclamation.
After you enable the backup strategy, the generated data backups and log backups will be stored in the object storage of your corresponding cloud service provider in the specified region. Depending on the object storage billing policies of the cloud service provider, you may need to pay for the storage space of the backup files. Please check your cloud service provider account balance.
Note
Instances created before the end of November 2023 need to manually enable the backup feature. New instances created after this date will have the backup strategy enabled by default.
Modify the backup strategy
Log in to the OceanBase Cloud console.
In the left-side navigation pane, click Instances.
In the instance list, click the name of the target instance to go to the Overview page.
In the left-side navigation pane, click Backup, and click Modify Backup Strategy in the upper-right corner.
On the Modify Backup Strategy page, configure the backup strategy.
Configure local backup settings.
Parameter Default value Description Backup File Storage Region Local The backup file storage region is the city where the current instance is located. Data Backup Type Full Only full backup is supported. Log Backup Enabled by default After the backup strategy is configured and enabled, log backup is automatically enabled and cannot be disabled. Backup Cycle The next day at 04:00 AM after the instance is created You can select the dates for backup and perform backup operations on the specified weekly or monthly dates. For data security, please back up your data at least once a week. Backup Time 04:00 AM You can set the specific backup time in the drop-down list. - Please perform backup operations during off-peak hours based on your actual situation.
- Avoid setting the backup time within the data compaction window (one hour before and after the data compaction time), as this may cause the backup task to be delayed.
Data Backup Retention Days / PITR Window 7 Days By default, backup data is retained for 7 days, and you can retain it for 2 to 7,200 days. For more information about the relationship between Backup Cycle and Data Backup Retention Days / PITR Window, see Backup cycle and data backup retention period. Archive Backup Disabled by default Backup data can be retained for 60 to 7,200 days. Note
- For backup files that need to be retained for a long time and restored infrequently, you can enable archive backup to save them. After archive backup is enabled, backup files exceeding the retention period set in the primary backup will be migrated to archive backup. Backup files migrated to archive backup must be stored for at least 60 days. If you disable archive backup midway, you need to make up for the storage cost for the remaining days to reach 60 days.
- Currently, only Alibaba Cloud supports archive backup, and it is a whitelist feature. To enable it, contact OceanBase Technical Support.
Sparse Backup Disabled by default You can enable sparse backup based on your business needs. - The backup cycle of sparse backup depends on the primary backup cycle. You can select a date from the dates selected in the primary backup cycle.
- You can customize the retention period of sparse backup data (60 to 7,200 days) or set it to be retained indefinitely.
- You can choose whether to retain log backups.
Backup Retention Strategy upon Instance Release Retain all existing data backups and their corresponding log backups - When you release an instance, all existing data backups and their corresponding log backups will be retained, allowing you to view and restore data in the instance recycle bin (except when the backup data is released due to refund, 5-day no-questions-asked refund, overdue release of prepaid instances, or debt release of postpaid instances). Please note that if your account balance is insufficient, the system will automatically clear the relevant backup data from the instance recycle bin.
- Do not retain backups (data cannot be restored after release).
Note
Retaining backup files when releasing an instance incurs costs. For details, see Backup and restore billing.
Click OK.
Backup cycle and data backup retention period
Basic concepts
A backup cycle refers to the time interval between full data backups. It can be weekly, daily, or custom (e.g., Monday, Wednesday, and Friday). The length of the backup cycle affects the density of backup sets and the granularity of recovery.
The data backup retention period determines the backup lifecycle. It ensures that you can perform Point-in-Time Recovery (PITR) at any time. Backups that exceed the retention period are automatically deleted.
Implementation mechanism
The backup cycle and data backup retention period together determine the number of data backup sets and the actual retention period of log backups.
The system retains backup sets based on the correlation between data and logs to ensure that you can perform PITR within the configured time range.
Data recovery typically relies on the most recent data backup before the recovery point and the log backups between them. To ensure data can be recovered within the retention period, the actual backup retention period may exceed the configured value.
Typical configuration examples
Example 1: Weekly backup
| Backup cycle | Data backup retention period / Arbitrary recovery time period | Maximum number of data backup sets | Estimated actual retention period of log backups |
|---|---|---|---|
| Weekly backup | 2 days | 2 sets | [2, 10] days |
| Weekly backup | 7 days | 3 sets | [8, 15] days |
Example 2: Daily backup
| Backup cycle | Data backup retention period / Arbitrary recovery time period | Maximum number of data backup sets | Estimated actual retention period of log backups |
|---|---|---|---|
| Daily backup | 2 days | 3 sets | [2, 4] days |
| Daily backup | 7 days | 8 sets | [8, 9] days |
Example 3: Backup on Monday, Wednesday, and Friday
| Backup cycle | Data backup retention period / Arbitrary recovery time period | Maximum number of data backup sets | Estimated actual retention period of log backups |
|---|---|---|---|
| Backup on Monday, Wednesday, and Friday | 2 days | 3 sets | [3, 5] days |
| Backup on Monday, Wednesday, and Friday | 7 days | 4 sets | [8, 10] days |