This topic describes how to clone a tenant. You can clone a new tenant from a specified tenant. The number of resource units and the distribution of units across OBServer nodes in the cloned new tenant are consistent with those of the source tenant.
Note
Starting from OceanBase Database V4.3.x, we recommend that you do not use the primary tenant cloning feature. Starting from OceanBase V4.4.2 BP2, if you attempt to clone the primary tenant, the system will directly report an error and the operation cannot be completed. If you have already used the primary tenant cloning feature in a production environment, please contact the OceanBase Technical Support Team promptly for risk assessment and migration guidance to avoid impacting your business due to subsequent version upgrades.
The standby tenant cloning feature is an experimental feature. Before using it, please ensure you understand its usage boundaries and associated risks. The primary application scenario for standby tenant cloning is standby database drills.
You can clone a tenant by using one of the following two methods:
Clone a tenant on the Tenant List page.
Clone a tenant on the Overview page of the specified tenant.
Prerequisites
Ensure the current user logged in to OCP has the following permissions:
- Cluster Maintenance resource permission.
- Permission to access the Overview menu for tenants.
The source tenant has been configured for log archiving by referring to Create a tenant-level backup strategy.
Considerations
- The status of the source tenant must be Running or Locked.
- Only the tenant's own configuration, such as resource units, can be cloned; service names and tags are not supported.
- When cloning a primary tenant, ensure the cluster to which the primary tenant belongs is V4.3.0.0 or later. When cloning a standby tenant, ensure the cluster to which the standby tenant belongs is V4.3.2.0 or later.
Procedure
Log in to OCP.
In the left navigation bar, select Tenant. The system goes to the Tenants tab by default.
On the Tenants page, find the target tenant and click Clone in the Actions column.
In the dialog box that appears, configure the relevant information for the new tenant. The details are as follows.
- Tenant Name: The name of the cloned new tenant. It must start with a letter and end with a letter or number, can contain letters, numbers, and underscores, and be 2 to 32 characters long.
- Clone Tenant Parameters: Whether to use the same parameter configuration as the source tenant. This is enabled by default.
- Replica Details: Configure the unit specifications for the cloned new tenant. Since unit specifications affect cloning speed, the system will default to using the higher-specification unit of the source tenant, and the unit specifications must be consistent across zones.
- Allowlist: By default, this is consistent with the source tenant. You can modify it after cloning the tenant on the tenant overview page.
- Perform a Minor Compaction before Cloning Tenant: If you want to clone the tenant immediately, you can choose to perform a minor compaction before cloning. Performing a minor compaction prolongs the response time for stopping processes but significantly shortens OBServer recovery time.
Click OK.
