OceanBase Database supports the creation of periodic backup strategies, which allow for scheduled full backups at specified intervals. Additionally, it can simultaneously initiate log backups and automatically clean up expired backup files.
Background information
After a backup strategy is enabled, data backups and log backups are stored in the object storage service of the corresponding region of your cloud service vendor. You may be charged for the storage space occupied by backup files based on the billing strategy for the object storage service of your cloud service vendor. Make sure that your cloud service account has a sufficient balance.
Note
- Clusters created before the end of November 2023 will need to manually enable the backup feature. For Tencent Cloud and AWS clusters created after this date, the backup feature will be enabled by default in DBaaS or SaaS mode. In MaaS mode, manual activation will still be required.
- For Tencent Cloud clusters, the backup feature is not supported for OceanBase Database versions later than V4.0.0 but earlier than V4.2.1.
Modify a backup strategy
Log in to the OceanBase Cloud console.
In the left-side navigation pane, click Instances.
In the instance list, find the target instance, click the instance name, and go to the Overview page.
Click Backup in the left-side navigation pane, then click Modify a backup policy in the upper-right corner of the page.
On the Modify a backup policy page, set the parameters of the backup strategy.
Set the parameters related to local backup.
Parameter Default Value Description Backup File Storage Region Local The backup file is saved in the region where the current cluster instance is located. Data Backup Type Full At present, only full backup is supported. Log Backup Enabled by default After a log backup is enabled, it cannot be disabled. Backup Cycle 04:00 a.m. on the next day after the instance is created You can specify the dates for backup on a weekly or monthly basis. We recommend that you back up your data at least once a week for security reasons. Backup Time 04:00 a.m. You can select a backup time from the drop-down list. - We recommend that you select a time during off-peak hours.
- Do not select a backup time within the major compaction window (one hour before and one hour after a major compaction). Otherwise, the backup task will be delayed.
Data Backup Retention Days / PITR Window 7 days By default, backup data is retained for 7 days. You can retain backup data for 2 to 7,200 days. For more information about the relationship between the Backup Cycle and Data Backup Retention Days / PITR Window, see [Considerations](#Relationship between backup cycle and data backup retention days). Sparse Backup Disabled You can enable sparse backup as needed. - The backup cycle of sparse backup depends on local primary backup, and you can select dates for sparse backup from the dates selected for primary backup.
- You can retain sparse backup data for 60 to 7,200 days or permanently.
- You can choose whether to retain log backup data.
Backup Retention Policy When Releasing Instance Retain all existing data backups and corresponding log backups - When releasing an instance, retaining all existing data backups and corresponding log backups allows you to view and restore data from the instance recycle bin (when receiving refunds, during a five-day no-questions-asked refund, prepaid expiration release, or postpaid overdue release, backup data will not enter the recycle bin). Also, please be aware that if your account balance is insufficient, the system will automatically clean up related backup data from the instance recycle bin.
- Do not retain backups (data cannot be recovered after release).
Note
Retaining backup files when releasing an instance incurs costs. For detailed pricing information, please refer to Backup billing.
(Optional) Set the parameters related to cross-region backup. The cross-region backup feature is disabled by default.
Parameter Default Value Description Cross-Region Backup Storage Region You can set only one cross-region backup storage region, and this region cannot be modified after it is confirmed. Note
When cross-border backup is involved, you must sign the commitment to cross-border data transfer compliance. For more information, see Commitment to cross-border data transfer compliance.
Backup Cycle None You can specify the dates for backup on a weekly basis. We recommend that you back up your data at least once a week for security reasons. Data Backup Retention Days 7 days You can retain backup data for 7 to 7,200 days.
Click OK.
Relationship between the backup cycle and the data backup retention period
Basic concepts
The backup cycle indicates the time interval for performing full data backups. You can back up data on a weekly, daily, or custom basis (for example, you can back up data on Mondays, Wednesdays, and Fridays). The backup cycle interval affects the density of backup set generation and the restore granularity.
The data backup retention period controls the backup lifecycle and ensures the ability to perform Point-in-Time Recovery (PITR). Excess backup data will be automatically deleted.
Implementation mechanism
The backup cycle and the data backup retention period determine the maximum number of data backup sets that can be retained and the actual number of days that log backups can be retained.
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.
In general, data is restored based on the most recent data backup before the specified restore time point and the log backups between the data backup and the restore time point. To ensure that data can be restored within the retention period, the actual backup retention period may be longer than the configured period.
Typical configurations
Example 1: Weekly backup
| Backup cycle | Data backup retention period / Maximum restore time period | Maximum number of data backup sets retained | Expected actual log backup retention period |
|---|---|---|---|
| Backup once a week | 2 days | 2 sets | [2, 10] days |
| Backup once a week | 7 days | 3 sets | [8, 15] days |
Example 2: Daily backup
| Backup cycle | Data backup retention period / Maximum restore time period | Maximum number of data backup sets retained | Expected actual log backup retention period |
|---|---|---|---|
| Backup once a day | 2 days | 3 sets | [2, 4] days |
| Backup once a day | 7 days | 8 sets | [8, 9] days |
Example 3: Backup on Mondays, Wednesdays, and Fridays
| Backup cycle | Data backup retention period / Maximum restore time period | Maximum number of data backup sets retained | Expected actual log backup retention period |
|---|---|---|---|
| Backup on Mondays, Wednesdays, and Fridays | 2 days | 3 sets | [3, 5] days |
| Backup on Mondays, Wednesdays, and Fridays | 7 days | 4 sets | [8, 10] days |
Commitment for data cross-border compliance
When cross-border backup is involved in offsite backup, you must sign the commitment for data cross-border compliance, which is described as follows:
If the region you choose or where the product is deployed involves cross-border data transmission, you will obtain full disposal rights over the business data and be fully responsible for the behavior of data transmission after you confirm and agree with the commitment. You must ensure that your data transmission behavior complies with all applicable laws, including providing adequate data security protection techniques and strategies, and fulfilling legal obligations such as obtaining individual express consent and completing security assessment and reporting for cross-border data transfer. You must also promise that your business data does not contain any content that is restricted or prohibited from transmission or disclosure under applicable laws. You shall bear the corresponding legal consequences for failing to comply with the aforesaid statements and warranties, and assume compensation liability for any loss suffered by Alibaba Cloud, OceanBase, or any associated company.