Tenants lay the foundation for database object management and resource management. They serve as containers for both database objects and resources such as CPU, memory, and I/O resources. You can create and manage tenants in the ApsaraDB for OceanBase console.
Prerequisites
You have created a cluster instance. For more information, see Purchase an instance.
Limitations
You can calculate the maximum number of tenants that can be created for a single cluster instance based on the following rule:
Maximum number of tenants = Min (Number of CPU cores per node × Number of nodes in the cluster, Maximum number of tenants allowed for the cluster). The maximum number of tenants allowed for the cluster is 50.
You can create at most 32 tenants for a cluster instance in a 2F scenario and 50 tenants in a 3F scenario.
Procedure
Log on to the ApsaraDB for OceanBase console.
In the left-side navigation pane, click Instances.
In the instance list, click the name of the target cluster instance to go to the Cluster Instance Workspace page.
In the upper-right corner of the page that appears, click Create Tenant.
Configure the tenant parameters as needed.
Parameter
Description
Tenant Name
The name of the tenant.
The name must be 2 to 64 characters in length and can contain Chinese characters, digits, letters, underscores (_), and hyphens (-). The name is case-sensitive and must start with a letter or underscore. It cannot be set to `sys`.
Tenant Mode
The tenant mode, which can be Oracle or MySQL.
Parameter Template
The ApsaraDB for OceanBase console provides four different parameter templates. For more information about the parameters and variables, see Parameter templates.
NoteYou can configure a parameter template only for OceanBase Database V4.3.3 and later.
Simple OLTP: suitable for core systems for Internet businesses that require point queries with high concurrency, such as online order transactions and payments. The SQL statements executed are simple, ensuring a fast response speed.
Complex OLTP: suitable for online transaction systems with complex transactions. This includes handling long-running and large transactions that involve complex joins, subqueries, and batch jobs written in PL. If a cluster instance is dedicated for online transactional processing (OLTP) workloads, we recommend that you optimize the value of the
large_query_threshold
parameter from the default 600 seconds to 5 seconds.HTAP: suitable for systems that simultaneously run OLTP and online analytical processing (OLAP) workloads for improved performance in online analysis though a vectorized engine.
OLAP: suitable for real-time data warehouses that require OLAP. By default, tables created use column store and an optimized vectorized engine to enhance performance for complex analysis. If a cluster instance is dedicated for OLAP workloads, we recommend that you optimize system variables and cluster parameters. This includes enabling adaptive parallel computation, optimizing SQL statement sorting memory, configuring timeout settings for SQL statements and transactions, and adjusting large query strategies. We also recommend that you use the character set
10utf8mb4_bin
for tenants.
Single-node Resources
The CPU and memory capacities on a single node of the tenant.
NoteThe total CPU and memory capacities of all tenants cannot exceed the specifications of the cluster to which they belong.
Total available resources of a tenant = Single-node resources × Number of resource distribution nodes × Number of replicas
Character set
The character set to be used in the database, which can be UTF8MB4 or GBK.
Time Zone
The time zone of the tenant.
VPC
The ID of the virtual private cloud (VPC) to which the Elastic Compute Service (ECS) instance belongs.
If no suitable VPC is available, create a VPC as prompted. For more information, see What is a VPC?
Primary Zone
The primary zone of the tenant. We recommend that you create the tenant in the same zone as the database access service.
vSwitch
The ID of the vSwitch to which the ECS instance belongs.
If no suitable vSwitch is available, create a vSwitch as prompted. For more information, see Create and manage a vSwitch.
Tenant Allowlist
Cluster whitelist groups are automatically synchronized to tenants. Modifications to cluster whitelists apply to all tenants. You can add other allowlists for the tenant later.
Remarks (Optional)
The remarks on the task. The length of the remarks cannot exceed 30 characters.
Click Create. You can view the tenant creation progress on the Instances page.