OceanBase Cloud Platform (OCP) allows you to configure personalized backup and restore strategies based on the tenant dimension. After you create a tenant-level backup strategy for a tenant, the tenant is no longer affected by the cluster-level backup strategy.
You can create a tenant-level backup strategy by using the following two methods:
Method 1: Log in to the OCP console. In the left-side navigation pane, choose
Backup & Recovery >Backups . Then, you can create a tenant-level backup strategy on theBackups page.Method 2: Log in to the OCP console and go to the
Overview page of the target tenant. In the left-side navigation pane, clickBackup & Recovery . Then, you can create a tenant-level backup strategy on theBackup & Recovery page.
Note
If a cluster-level backup strategy exists in the cluster to which the tenant belongs, the content of the cluster-level backup strategy is populated by default when you create a tenant-level backup strategy.
Prerequisites
To create a tenant-level backup strategy by using Method 1, make sure that you have the following permissions:
-
Resource Permissions : Cluster Maintenance or Tenant Maintenance permission -
Menu Permissions : Permission on theBackup menu ofBackup & Recovery
-
To create a tenant-level backup strategy by using Method 2, make sure that you have the following permissions:
-
Resource Permissions : Cluster Maintenance or Tenant Maintenance permission -
Menu Permissions : Permission on theBackup & Recovery menu ofTenants
-
You can create backup strategies only for tenants of a cluster of OceanBase Database V4.0.0 or later.
If the OceanBase Database version of the cluster is V4.0.0 or later, make sure that the following requirements are met before you configure second backup:
- To enable second backup, which is disabled by default, change the value of the
ocp.backup.advanced-secondary-backup.enableparameter totrueinSystem Parameters . - The storage media for both regular backup and second backup is Alibaba Cloud Object Storage Service (OSS).
- The retention period of second backup files is shorter than that of regular backup files.
- If the backup scheduling cycle is weekly, the retention period of second backup files must be longer than or equal to 7 days. If the backup scheduling cycle is monthly, the retention period of second backup files must be longer than or equal to 30 days.
- Regular backup files and second backup files cannot be stored in the same bucket. In addition, you cannot specify a custom storage path for second backup files.
- The AccessKey pair of a regular backup job must have the permissions for cross-region replication. Otherwise, the job cannot be scheduled. If the job fails to be executed, you can retry the job after you configure the permissions.
- The bucket for regular backup cannot be configured with cross-region replication rules. Otherwise, the job cannot be scheduled. If the job fails to be executed, you can retry the job after you delete these rules.
- If the destination of a second backup job is an independently deployed OSS bucket, you must configure the
cloudNameandcloudLocationfields of the OSS bucket inSystem Parameters . The corresponding parameters areocp.backup.advanced-secondary-backup.target-cloud-nameandocp.backup.advanced-secondary-backup.target-cloud-location.
- To enable second backup, which is disabled by default, change the value of the
Procedure
The procedure of Method 1 is described as follows:
Log in to the OCP console. In the left-side navigation pane, choose
Backup & Recovery >Backups .On the
Backups page, hover the pointer overNew Backup Strategy and selectCreate Tenant-level Backup Strategy .Select the tenant to back up from the drop-down list.
For a cluster of a version earlier than OceanBase Database V2.2.60, logical backup is used.
For a cluster of OceanBase Database V2.2.60 and later, physical backup is used.
Specify the following storage configuration parameters and click
Test .For logical backup, select the storage configuration configured during service installation.
If no backup service is installed, you must first install the backup service. For more information, see Install a service.
For physical backup, you can configure a custom configuration or select an existing configuration. If you choose to configure a custom configuration, configure the parameters based on the following tables. If you choose to select an existing configuration, click
Select Existing Configuration . Then, the system automatically populates the following parameters.Notice
If the native Alibaba Cloud Object Storage Service (OSS) or Tencent Cloud Object Storage (COS) storage type is available, we recommend that you select the OSS or COS storage type.
File : your local file storage system. Generally, Network File System (NFS) is used.Parameter Description Storage Directory The directory in which the backup files are stored on the storage service. If you have configured a backup strategy for the cluster to which the tenant belongs, we recommend that you specify the same storage directory as that of the cluster. Otherwise, the backup statistics of the tenant will be affected. Alert Threshold for Backup Storage Capacity The threshold for backup storage capacity alerts. Default value: 80%.OSS: Alibaba Cloud OSS, which is supported only in OceanBase Database V2.2.76 and later.
Parameter Description Storage Directory The directory in which the backup files are stored on the storage service. If you have configured a backup strategy for the cluster to which the tenant belongs, we recommend that you specify the same storage directory as that of the cluster. Otherwise, the backup statistics of the tenant will be affected. Domain The domain name for accessing the files stored in Alibaba Cloud OSS, such as oss-cn-hangzhou.aliyuncs.com.User The user for accessing the files stored in Alibaba Cloud OSS. AccessKey Pair The AccessKey pair for accessing the files stored in Alibaba Cloud OSS. COS: Tencent Cloud COS, which is supported only in OceanBase Database V2.2.76 and later but earlier than V4.0, and in OceanBase Database V4.2.1 and later.
Parameter Description Storage Directory The directory in which the backup files are stored on the storage service. If you have configured a backup strategy for the cluster to which the tenant belongs, we recommend that you specify the same storage directory as that of the cluster. Otherwise, the backup statistics of the tenant will be affected. Domain The domain name for accessing the files stored in the COS bucket, such as cos.ap-beijing.myqcloud.com.Resource Identity (APPID) The unique resource identifier at the user dimension when you access the COS bucket as a developer. You can obtain the APPID on the API key management page of COS. Project ID The ID of the developer. You can obtain the ID on the API key management page of COS. Project Key The key of the developer. You can obtain the key on the API key management page of COS. S3: object storage services that support the AWS Simple Storage Service (S3) protocol, such as the native Amazon Web Services (AWS) S3, Huawei Cloud OBS, Tianyi Cloud OBS, and Google Cloud Storage (GCS). These object storage services are supported only in OceanBase Database V4.2.1-BP7, V4.2.3-BP1, and later. For more information about Amazon S3-compatible object storage services, see Amazon S3 protocol.
Parameter Description Storage Directory The directory in which the backup files are stored on the storage service. If you have configured a backup strategy for the cluster to which the tenant belongs, we recommend that you specify the same storage directory as that of the cluster. Otherwise, the backup statistics of the tenant will be affected. Domain The domain name for accessing the files stored in the S3 bucket, such as s3.us-west-2.amazonaws.com.AK The AccessKey ID of the S3 bucket. SK The AccessKey secret of the S3 bucket. Region The region of the S3 bucket. Notice
The Region parameter is required when Amazon S3 is used, and is not required when Huawei Cloud OBS, Tianyi Cloud OBS, or GCS is used.
Specify parameters in the
Scheduling Settings section.Scheduling Cycle : If you set the scheduling cycle to Month, you can select at most 10 days.After the log backup is disabled for physical backup, the system enables the log backup before the data backup starts, and then disables the log backup after the data backup is completed.
Schedule the cleanup of expired backup files.
Specify alert thresholds. You can specify the timeout threshold for data backup jobs, alert threshold for log backup delays, and alert threshold for the number of days without successful data backup. After you set a threshold, an alert is triggered when the threshold is reached.
(Optional) Configure second backup settings.
To back up the data backup files and log backup files to another directory, turn on
Second Backup .Configure storage settings for second backup.
Configure scheduling settings for second backup.
Click
Create .