You can create a standby tenant for an existing primary or standby tenant. OceanBase Cloud Platform (OCP) allows you to create multiple standby tenants for a single primary tenant (one-to-many), and create a standby tenant for an existing standby tenant (cascading).
Background information
In OceanBase Database V4.1.0 and later, the Physical Standby Database solution is provided in the form of primary/standby tenants. Clusters are no longer assigned the PRIMARY or STANDBY role and are only containers of primary and standby tenants. The primary tenant is a business tenant that supports complete database capabilities, including queries, data manipulation language (DML) operations, and data definition language (DDL) operations. A standby tenant only provides disaster recovery and read-only services. The tenant-level Physical Standby Database high availability solution comprises one primary tenant and multiple standby tenants.
Prerequisites
Make sure that you have the following permissions:
-
Resource Permissions : Cluster Maintenance permission -
Menu Permissions : Permission on theOverview menu ofTenants
-
Primary/Standby tenants are configured in OceanBase Database V4.2 or later.
When you create a standby tenant in OceanBase Database of a version earlier than V4.2.1.8, do not restore the Physical Standby Database feature from baseline backup data older than 30 days. Otherwise, the feature may malfunction, affecting major compactions of the tenant.
The cluster to which the standby tenant belongs is in the
Running state.(Optional) You have created a parameter template by referring to Manage tenant parameter templates.
If you need to create multiple tenants with the same parameter configuration, you can use a parameter template to avoid repeatedly configuring the same parameters.
The following conditions are met before you enable the arbitration service for a tenant:
The arbitration service is added for the cluster to which the tenant belongs, and the service is in the
Running state.The locality of the tenant includes two or four full-featured replicas.
The resources available on the server hosting the arbitration service meet the resource requirements.
You can modify the resource requirements by using the following system parameters based on your business requirements. For more information, see Modify system parameters.
ocp.arbitration.min.remain.disk.size: the minimum size in MB of the clog disk on the arbitration service host required when the arbitration service is enabled for the tenant. The parameter value is in the (a,b) format, indicating the minimum clog disk sizes required when the tenant has two and four full-featured replicas, respectively. Default value: [12,24].ocp.arbitration.max.cpu.used.percentage: the maximum CPU utilization in percentage (%) allowed on the arbitration service host when the arbitration service is enabled for the tenant. Default value:90.ocp.arbitration.max.memory.used.percentage: the maximum memory usage in percentage (%) allowed on the arbitration service host when the arbitration service is enabled for the tenant. Default value:90.
Procedure
You can create a standby tenant by using any of the following methods:
Method 1: Log in to the OCP console, go to the
Tenants page, and clickCreate Tenant in the upper-right corner.Method 2: Log in to the OCP console, go to the
Overview page of a cluster, and clickCreate Tenant in the upper-right corner.Method 3: Log in to the OCP console, go to the
Overview page of a cluster, selectTenant Management in the left-side navigation pane, and clickCreate Tenant in the upper-right corner.Method 4: Log in to the OCP console, go to the
Overview page of a tenant, click theMore icon in the upper-right corner, and selectCreate Tenant .
The procedure of Method 1 is described as follows:
Log in to the OCP console.
In the left-side navigation pane, select
Tenants . TheTenants page automatically appears.On the
Tenants page, clickCreate Tenant in the upper-right corner.
Specify the parameters in the
Basic Settings section.The following table describes the parameters.
Parameter Description Tenant Type Select Standby Tenant .Note
When you create a standby tenant on the
Overview page of a specified tenant, you cannot select a tenant type. The default value isStandby Tenant.OCP Cluster of Primary Tenant Select the OCP cluster that manages the primary tenant. This parameter is required in multi-cluster mode of OCP. Note
When you create a standby tenant on the
Overview page of a specified tenant, you do not need to specify this parameter.Cluster of Primary Tenant Select the cluster to which the primary tenant belongs. Note
When you create a standby tenant on the
Overview page of a specified tenant, the current cluster is displayed by default and you cannot modify the setting.Primary Tenant Select the primary tenant of the standby tenant. Note
When you create a standby tenant on the
Overview page of a specified tenant, the current tenant is regarded as the primary tenant by default and you cannot modify the setting.Cluster of Standby Tenant Select the cluster to which the standby tenant belongs. Note
When you create a standby tenant on the
Tenant Management page of a specified cluster, the current cluster is displayed by default and you cannot modify the setting.Standby Tenant Name The tenant name must start with a letter and end with a letter or a digit. It can contain letters, digits, and underscores (_). It must be 2 to 32 characters in length. Service Name Optional. The service name is a new database access method provided by OceanBase Database. It can be considered as the alias of the cluster name and tenant name. This way, an application can access the database by using the service name. For more information, see Manage service names. - The service name must start with a letter and can contain letters, digits, and underscores (_). It must be 2 to 64 characters in length.
- You can configure a service name for a tenant only when the following version requirements are met:
- OceanBase Database: V4.2.1.9, [V4.2.4.0, V4.3.0.0), or [V4.3.3.0, +∞)
- OBProxy: [V4.3.1.0, +∞)
Note
If
Service Name has been configured for the primary tenant, the specified service name is automatically populated here.Primary/Standby Synchronization Method The synchronization mode between the primary and standby tenants. Two synchronization modes are supported: Network-based Synchronization andArchiving-based .- In network-based synchronization mode, logs are synchronized through the remote procedure call (RPC) network between OBServer nodes. A standby tenant can directly read logs from the primary tenant by using an IP address and a port number. By default, the network-based synchronization mode is used for synchronization between the primary and standby tenants.
- In archiving-based synchronization mode, logs are synchronized based on shared storage. The primary tenant writes logs to a network disk or Alibaba Cloud Object Storage Service (OSS), and the standby tenant reads data from the shared storage. To use the archiving-based synchronization mode, make sure that archiving has been enabled for the current tenant. Otherwise, you cannot synchronize data based on archiving. For more information about how to enable archiving for a tenant in the OCP console, see Back up tenant now.
Note
If a cascading or one-to-many primary/standby relationship already exists, the primary/standby synchronization mode that is already in use is selected by default and you cannot modify the setting.
Load Type You can select a load type for the tenant. Select a load type based on the actual loads to avoid compromising the runtime performance metrics of the database. The following load types are supported: - Express OLTP: suitable for workloads such as trading and core payment systems and high-throughput online applications. Such workloads do not involve restrictions such as foreign keys, stored procedures, long-running or large transactions, complex join operations, or complex subqueries.
Supported versions: This template applies to OceanBase Database V4.2.5 and later. - HTAP: suitable for hybrid transaction and analytical processing (HTAP) workloads. You can use it to quickly get insights from campaign operation data, fraud detection, and scenario-specific recommendations.
Supported versions: This template applies to OceanBase Database V4.2.5 and later. - OLAP: suitable for real-time data warehouse analytics.
Supported versions: This template applies to OceanBase Database V4.3.0 and later. - Complex OLTP: suitable for workloads such as banking and insurance systems. These workloads often involve complex join operations, complex subqueries, batch processing jobs compiled in PL, long-running transactions, and large transactions. Short-running queries are sometimes executed in parallel.
Supported versions: This template applies to OceanBase Database V4.2.5 and later. - OBKV: suitable for workloads that involve a high throughput and are sensitive to latency, such as key-value workloads and wide-column workloads of an HBase database.
Supported versions: This template applies to OceanBase Database V4.2.5 and later.
Note
We recommend that the load type of the tenant be the same as that of the cluster to which it belongs.

Specify the backup set information in the
Restore Standby Tenant Settings section. You can choose whether to specify an independent storage directory for the standby tenant based on the application scenario.Note
If the network-based synchronization mode is used and the REDO logs of the primary tenant are complete, you do not need to configure the parameters in this section. You can also click Restore by Using Backup Set and configure backup set information to restore the standby tenant by using the backup set.
Specify an independent storage directory
You can specify an independent storage directory if you have backed up the standby tenant by using a CLI instead of the tenant backup feature of OCP, or you have copied the external backup files of the primary tenant to a shared storage service and you want to restore the standby tenant by using the backup files.
Parameter Description Backup Set Storage Type The storage service for backup files. Valid values: -
File : your local file storage system. Generally, Network File System (NFS) is used. - OSS: Alibaba Cloud Object Storage Service (OSS), which is supported only in OceanBase Database V2.2.76 and later.
- COS: Tencent Cloud Object Storage (COS), which is supported only in OceanBase Database V2.2.76 or later but earlier than V4.0.0, and in OceanBase Database V4.2.1 and later.
Data Backup Directory The data storage directory on the current storage service for backup files. Log Backup Directory The log storage directory on the current storage service for backup files. Domain The domain name for accessing the cloud storage service where the backup set is stored. - If you select OSS for
Backup Set Storage Type , enter the domain name for accessing backup files in the OSS bucket. You can append a port number to the domain name, such asoss.ap-shanghai.myqcloud.com:8080. - If you select COS for
Backup Set Storage Type , enter the domain name for accessing objects in the COS bucket, such ascos.ap-beijing.myqcloud.com.
User If you select OSS for Backup Set Storage Type , enter the user for accessing the files stored in the OSS bucket.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. This parameter is displayed only if you have selected COS for Backup Set Storage Type .Project ID The project ID of a developer. You can obtain the ID on the API key management page of COS. This parameter is displayed only if you have selected COS for Backup Set Storage Type .AccessKey Pair If you select OSS or COS for Backup Set Storage Type , enter the AccessKey pair for accessing the files stored in the OSS or COS bucket.-
Do not specify an independent storage directory
If you have backed up the standby tenant by using the tenant backup feature of OCP, you can choose not to specify an independent storage directory. In this case, the system automatically populates the information about the storage directory, which cannot be modified.
Parameter Description Storage Directory The backup directory on the current storage service for backup files. Domain The domain name for accessing the cloud storage service where the backup set is stored. - If you select OSS for
Backup Set Storage Type , enter the domain name for accessing backup files in the OSS bucket. You can append a port number to the domain name, such asoss.ap-shanghai.myqcloud.com:8080. - If you select COS for
Backup Set Storage Type , enter the domain name for accessing objects in the COS bucket, such ascos.ap-beijing.myqcloud.com.
- If you select OSS for
Click
Backup Set Verification . The system checks the directory of the current backup set, whether the cluster of the standby tenant is accessible, and whether logs of the maximum restorable window of the current backup set and logs of the current primary tenant are consistent. If the check fails, you can locate and handle the issue based on the prompts.Specify the information in the
Standby Tenant Replica Settings section.By default, the system displays configurable zones based on the zone information of the selected cluster. If you do not need to create a replica in a zone, click the
Delete icon to delete the zone. The zone information parameters that need to be configured and their descriptions are listed in the following table.Parameter Description Replica Type The type of the replica. Select multiple full-featured replicas to ensure that they are in the majority. 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. -
Read-only Replica : A replica that contains full logs, MemTables, and SSTables. It does not participate in log voting as a member of the Paxos group. Instead, it works as an observer that synchronizes logs from the Paxos group members and then locally replays the logs. -
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 Columnstore Replica : This type of replica does not participate in Paxos-based voting. Baseline data of all user tables is stored in columnar storage mode and supports only read operations. It applies to quasi-real-time decision analysis for hybrid load processing with enhanced transaction processing (TP) capabilities.
Note
- A distributed cluster of OceanBase Database V4.3.3 or later supports full-featured, read-only, and read-only columnstore replicas.
- A distributed cluster of OceanBase Database V4.2.0 or a version later than V4.2.0 and earlier than V4.3.3 supports full-featured and read-only replicas.
- A distributed cluster of OceanBase Database V4.0.0 or a version later than V4.0.0 and earlier than V4.2.0 supports only full-featured replicas.
- A distributed cluster of OceanBase Database V3.x supports full-featured, read-only, and log replicas.
- In a standalone centralized database, only full-featured replicas are supported.
Unit Specification OCP has a set of built-in unit specifications. You can select the specification that you need from the list of unit specifications or click Add Specification at the bottom of the list to add a custom specification. For more information, see OCP resource unit specifications.Notice
- We recommend that you set the same specifications and number of units for all full-featured replicas. Different specifications or numbers of units can compromise the performance or stability.
- If the OceanBase Database version of the cluster is V4.0.0 or later, take note of the following considerations:
- You cannot configure less than one CPU core for the tenant.
- By default, the cluster limits the minimum memory size. You can adjust the limit by modifying the
__min_full_resource_pool_memoryparameter. For more information about how to modify the parameter of an OceanBase cluster of V4.1.0, see Modify cluster parameters.
Units The number of resource units in the zone. The number of resource units cannot exceed the number of OBServer nodes in the zone. - If the cluster version is OceanBase Database V4.0 or later, you can only set the same number of units for all zones, which is 1 by default.
- If the cluster version is earlier than OceanBase Database V4.0, you can set different numbers of units for different zones.
Note
In a standalone centralized database, the default number of units is 1, which cannot be modified.
Zone Priority Rankings Specifies whether to define priorities for the zones of the tenant. The priorities affect the priority of the primary zone of the sys tenant. - If this parameter is not specified, the zone priorities of the sys tenant are used by default.
- If
Zone Priority Rankings is enabled with no zone priorities, the random priority is used. - To configure zone priorities, you can select one or more zones from the list on the left that displays all zones in the current cluster and add the selected zones to the list on the right. By default, the priority of a zone added earlier is higher than that of a zone added later, and the zones added at the same time have the same priority. After you move the zones to the box on the right side, you can also drag them upward or downward to adjust their priority order. A zone takes priority over those beneath it.
Note
In a standalone centralized database, the zone priority rankings are not displayed, and Zone1 has the highest priority by default.
Enable Arbitration Service Specifies whether to enable the arbitration service for the tenant. The arbitration service is disabled by default. Note
- We recommend that you keep the replica specifications of the standby tenant consistent with those of the primary tenant.
- If the replica type of the primary tenant is not Read-only Columnstore Replica, we recommend that you do not select Read-only Columnstore Replica for the standby tenant.
-
Enable
Parameter Settings and configure the tenant parameters.If you have selected a load type in the
Basic Settings section, the system automatically selects the parameter template corresponding to the selected load type.You can click the button in section ① of the following figure to add startup parameters one by one and set their values.
You can also click
Select Parameter Template as shown in section ② of the following figure and select a parameter template. The system will automatically populate parameters in this section by using the template. If no tenant parameter template is available, you can click Create Tenant Parameter Template to create one. For more information, see Manage tenant parameter templates.The system provides four built-in templates that contain general parameters. You can use a template for cluster configuration. The following table describes the built-in templates.
Template Description Default Parameter Template for COMPLEX_OLTP The default template for the Complex OLTP load type. It applies only to OceanBase Database V4.2.5 and later. Default Parameter Template for HTAP The default template for the HTAP load type. It applies only to OceanBase Database V4.2.5 and later. Default Parameter Template for OLAP The default template for the OLAP load type. It applies only to OceanBase Database V4.3.0 and later. Default Parameter Template for EXPRESS_OLTP The default template for the Express OLTP load type. It applies only to OceanBase Database V4.2.5 and later.
Note
If you are creating a tenant in MySQL mode by using a parameter template that contains parameters that are valid only in Oracle mode, you must manually delete those parameters.
Click
Submit .The page that appears prompts you that the tenant creation task has been submitted and displays the summary information of the task.
- To view the task details, click
View Task Details . - To return to the
Tenants list, clickReturn to Tenants List . In theTenants list, you can view the status and task details of the new tenant, and delete the tenant if the tenant creation failed.
Note
When the task status is Completed, you can check the status of the new tenant in the Tenants list on the Tenant Management page. The new tenant is created if its status is Running.
- To view the task details, click