OceanBase Database supports creating periodic backup strategies to perform full backups at scheduled intervals.
Background Information
OceanBase Database uses the user-business-first mode by default for log backup. In scenarios where log backup speed cannot keep up with log generation, such as during large-scale data exports or backup media failures, logs may be reclaimed, leading to log stream interruptions. This can prevent Point-in-Time Recovery (PITR). To ensure PITR, you can contact OceanBase Technical Support to enable the Archive First log backup strategy or increase the log disk space to reduce the likelihood of log reclamation.
The periodic backup strategy in OceanBase Database supports performing full backups for specified instances, and can also simultaneously initiate log backups and automatically clean up expired backup files.
After enabling a backup strategy, the generated data backups and log backups are stored in the object storage of your cloud provider in the corresponding region. Depending on your cloud provider's object storage billing policy, you may be charged for the storage space used by the backup files. Please monitor the balance of your cloud provider account.
Note
- Instances created before the end of November 2023 require manual activation of the backup feature. For Tencent Cloud and AWS instances created after this date in DBaaS or SaaS mode, the backup strategy is enabled by default. Instances in MaaS mode still require manual activation.
- For Tencent Cloud instances, the backup and restore feature is not supported for OceanBase Database versions later than V4.0.0 but earlier than V4.2.1.
Create a Backup Strategy
Log in to the OceanBase Cloud console.
In the left navigation pane, click Instances.
In the instance list, find the target instance, click its name, and go to the instance Overview page.
In the left navigation pane, click Backup, then click Backup Strategy and then Enable backup policy.
On the Backup Strategy settings page, configure the backup strategy information.
ParameterDefault ValueDescriptionBackup Cycle 04:00 a.m. on the day after instance creation You can select the days of the week or months for weekly/monthly backups. For data security, back up at least once a week. Backup Time 04:00 a.m. Select a specific time from the drop-down list. - Perform backups during off-peak hours based on your actual situation.
- Avoid setting the backup time within the major compaction window (one hour before and one hour after a major compaction), as this will delay the backup task.
Data Backup Retention Days / Point-in-Time Recovery Window 7 Days Backup data is retained for 7 days by default. The retention period can be set from 2 to 730 days. For the relationship between Backup Cycle and Data Backup Retention Days / Point-in-Time Recovery Window, see [Explanation](#Relationship Between Backup Cycle and Data Backup Retention Days). Data Backup Type Full Currently, only full backup is supported. Log Backup Enabled by default After a backup strategy is successfully configured and enabled, log backup is automatically enabled and cannot be disabled. Cluster Backup Retention Strategy Do not retain all backup sets for this cluster instance After release, all backup sets for this cluster instance cannot be restored. Click OK.
After the backup strategy is successfully enabled, you can view its information on the Backup and Restore page, and you can also modify, disable, or enable it.
Note
After disabling a backup strategy, all historical automatic backups will be deleted. It is recommended that you restore backup data to a new instance before disabling this feature to avoid data loss.
Relationship Between Backup Cycle and Data Backup Retention Days
Basic concepts
- The backup cycle refers to the interval at which full data backups are performed. It can be set to back up once a week, once a day, or customize (for example, back up on Monday, Wednesday, and Friday of each week). The interval of the backup cycle affects the backup set generation density and the restore granularity.
- The number of days for retaining data backups controls the backup lifecycle to ensure Point-in-Time Recovery (PITR) at any point in time. Backups that exceed the retention period will be automatically deleted.
Implementation mechanism
The backup cycle and the number of days for retaining data backups jointly determine the final number of retained data backup sets and the actual number of retained log backups.
The system retains backup sets based on the correlation between data and logs, ensuring you can perform PITR within the configured time range.
Data restoration generally relies on the most recent data backup before the desired restore point and the log backups in between. To ensure data within the specified retention period is recoverable, the actual number of retained backups may exceed the configured number.
Typical configuration examples
Example 1: Back up once a week
Backup Cycle |
Data Backup Retention Days / Point-in-Time Recovery Window |
Maximum Number of Retained Data Backup Sets |
Estimated Actual Retention Days for Log Backup |
|---|---|---|---|
| Back up once a week | 2 Days | Two | [2, 10] Days |
| Back up once a week | 7 Days | Three | [8, 15] Days |
Example 2: Back up once a day
Backup Cycle |
Data Backup Retention Days / Point-in-Time Recovery Window |
Maximum Number of Retained Data Backup Sets |
Estimated Actual Retention Days for Log Backup |
|---|---|---|---|
| Back up daily | 2 Days | Three | [2, 4] Days |
| Back up daily | 7 Days | Eight | [8, 9] Days |
Example 3: Back up on Monday, Wednesday, and Friday of each week
Backup Cycle |
Data Backup Retention Days / Point-in-Time Recovery Window |
Maximum Number of Retained Data Backup Sets |
Estimated Actual Retention Days for Log Backup |
|---|---|---|---|
| Back up once a week on Monday, Wednesday, and Friday. | 2 Days | Three | [3, 5] Days |
| Back up once a week on Monday, Wednesday, and Friday. | 7 Days | Four | [8, 10] Days |
