You can initiate a restore task for a cluster that has been backed up.
You can initiate a restore task by using the following methods:
Method 1: Log in to the OceanBase Cloud Platform (OCP) console. In the left-side navigation pane, choose
Backup & Recovery >Recovery . On theBackup & Recovery page of the target cluster, clickInitiate Recovery .Method 2: Log in to the OCP console and go to the
Overview page of the target cluster. In the left-side navigation pane, clickBackup & Recovery . On theBackup & Recovery page of the target cluster, clickInitiate Recovery .Note
You cannot restore a cluster by using Method 2 in the following circumstances:
- The cluster is not in the Running state.
- The cluster does not have a backup strategy.
Method 3: Log in to the OCP console and go to the
Overview page of the target tenant. In the left-side navigation pane, clickBackup & Recovery . On theBackup & Recovery page of the target tenant, clickInitiate Recovery .Note
You cannot restore a tenant by using Method 3 in the following circumstances:
- The tenant is not in the Running state.
- The tenant does not have a backup strategy.
Prerequisites
To initiate a restore task by using Method 1, make sure that you have the following permissions:
-
Resource Permissions : Cluster Maintenance or Tenant Maintenance permission -
Menu Permissions : Permission on the Restore menu ofBackup & Recovery
-
To initiate a restore task by using Method 2, make sure that you have the following permissions:
-
Resource Permissions : Cluster Maintenance permission -
Menu Permissions : Permission on theBackup & Recovery menu ofClusters
-
To initiate a restore task by using Method 3, 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 have backed up the cluster to be restored. For more information, see Back up now.
When you restore a OceanBase cluster that is physically backed up, you cannot restore its data to a cluster of an earlier version.
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 >Recovery .On the
Recovery page, clickInitiate Recovery in the upper-right corner.(Optional) If you use Method 1, configure a custom storage configuration or use 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. Host for Parsing Select a host that can access the directory. To parse logical backup data, select the host where the backup and restore service resides. To parse physical backup data, select the host where a cluster of OceanBase Database V2.2.70 or later resides. Click Parse to obtain the list of clusters that can be restored.OSS: Alibaba Cloud OSS, which is supported only in OceanBase Database V2.2.76 and later.
Parameter Description Storage Directory Select the directory where the backup files are stored. 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. Host for Parsing Select a host that can access the directory. To parse logical backup data, select the host where the backup and restore service resides. To parse physical backup data, select the host where a cluster of OceanBase Database V2.2.70 or later resides. Click Parse to obtain the list of clusters that can be restored.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 Select the directory where the backup files are stored. 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. Host for Parsing Select a host that can access the directory. To parse logical backup data, select the host where the backup and restore service resides. To parse physical backup data, select the host where a cluster of OceanBase Database V2.2.70 or later resides. Click Parse to obtain the list of clusters that can be restored.OBS: Huawei Cloud Object Storage Service (OBS), which is supported only in OceanBase Database V3.2.3.2-105000062022090916 and later but earlier than V4.0.0.0.
Parameter Description Storage Directory Select the directory where the backup files are stored. Domain The domain name for accessing the files stored in the Huawei Cloud OBS bucket, such as obs.cn-north-4.myhuaweicloud.com.AK The access key ID for accessing the files stored in the OBS bucket. SK The secret access key for accessing the files stored in the OBS bucket. Host for Parsing Select a host that can access the directory. To parse logical backup data, select the host where the backup and restore service resides. To parse physical backup data, select the host where a cluster of OceanBase Database V2.2.70 or later resides. Click Parse to obtain the list of clusters that can be restored.S3: object storage services that support the Amazon Simple Storage Service (S3) protocol, such as the native Amazon 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 AWS S3 protocol.
Parameter Description Storage Directory The directory in which the backup files are stored on the storage service. Domain The domain name for accessing the files stored in the S3 bucket, such as s3.us-west-2.amazonaws.com.AK The access key ID for accessing the files stored in the S3 bucket. SK The secret access key for accessing the files stored in the S3 bucket. Region The region of the S3 bucket. Host for Parsing Select a host that can access the directory. To parse logical backup data, select the host where the backup and restore service resides. To parse physical backup data, select the host where a cluster of OceanBase Database V2.2.70 or later resides. Click Parse to obtain the list of clusters that can be restored.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 the restore source.
Restore a tenant
Parameter Description Source Cluster If you initiate a restore task from the O&M page of a cluster, the cluster is the source cluster by default, and you do not need to specify this parameter. Source Tenant Select the tenant to restore. Object to Restore Select Tenant .Recovery Date Select a date within the specified restorable time range. Restore Point in Time Select a point in time within the specified time range. Restore databases
Note
This feature is supported only in OceanBase Database V4.x.
If you use Method 3 to restore a tenant, you can restore databases in the tenant.
Parameter Description Source Cluster The source cluster to restore the tables. The default value is the cluster to which the current tenant belongs. Source Tenant The source tenant to restore the tables. The default value is the current tenant. Object to Restore Select Database .Recovery Date Select a date within the specified restorable time range. Restore Point in Time Select a point in time within the specified time range. Restore Database Object Select the databases to be restored in the Restorable Objects list on the left and click > to add them to the Selected Objects list on the right. The database names must be unique. OCP allows you to rename databases, as shown in the following figure.Note
You can select at most 200 database objects.
Restore tables
Note
- Only user tables can be restored. Columnstore tables, temporary tables, views, materialized views, materialized view logs, or indexes cannot be restored separately.
- The table restore is considered successful when the table data is restored, even if the indexes, constraints, or other associated schemas fail to be restored.
If you use Method 3 to restore a tenant, you can restore tables in the tenant.
Parameter Description Source Cluster The source cluster to restore the tables. The default value is the cluster to which the current tenant belongs. Source Tenant The source tenant to restore the tables. The default value is the current tenant. Object to Restore Select Table .Recovery Date Select a date within the specified restorable time range. Restore Point in Time Select a point in time within the specified time range. Restore Table Object Select the tables to be restored in the Restorable Objects list on the left and click > to add them to the Selected Objects list on the right. The table names must be unique. OCP allows you to rename tables, as shown in the following figure.Note
You can select at most 200 table objects.
Specify the restore target.
Note
During a database or table restore, you need to create an auxiliary tenant in the target cluster. We recommend that the specifications of the auxiliary tenant be consistent with those of the source tenant, and that the target cluster have sufficient CPU, memory, and disk resources. If the resources are insufficient, the restore may be slow or fail. After the restore is completed, the system will delete the auxiliary tenant by default.
Parameter Description Destination Cluster Select a target cluster. Destination Tenant Select a target tenant. Note
The following types of clusters cannot be used as the restore target:
- Clusters in primary/standby mode
- Clusters in the Unavailable state
- Clusters of an OceanBase Database version earlier than that of the source cluster
Specify the following zone-related parameters and set the priorities of the zones.
Parameter Description Replica Type Valid values: -
Full-featured Replica : A standard replica that contains all the data categories and all the features, including MemTables, SSTables, and transaction logs. A full-featured replica can switch to the leader role efficiently to provide services. -
Log Replica : A replica that contains only logs. It does not have a MemTable or an SSTable. It provides log services for external applications and participates in log voting. It can facilitate the restore of other replicas, but it cannot become the leader to provide database services. -
Read-only Replica : A replica that contains full logs, MemTables, and SSTables. You can select this type of replica for applications that does not require high consistency in data reading.
Unit Specification The specifications of the resources that the replica occupies. - You can select an existing specification.
- You can also create a specification as needed and select the created specification.
Units The number of resource units occupied by the replica. Notice
If the version of the target cluster is V4.0 or later, you can only set the same number of units for all zones. In other words, the number of units that you specify on this page applies to all zones under the restored tenant.-
Click
Initiate Recovery .