OceanBase logo

OceanBase

A unified distributed database ready for your transactional, analytical, and AI workloads.

DEPLOY YOUR WAY

OceanBase Cloud

The best way to deploy and scale OceanBase

OceanBase Enterprise

Run and manage OceanBase on your infra

TRY OPEN SOURCE

OceanBase Community Edition

The free, open-source distributed database

OceanBase seekdb

Open source AI native search database

Customer Stories

Real-world success stories from enterprises across diverse industries.

View All
BY USE CASES

Mission-Critical Transactions

Global & Multicloud Application

Elastic Scaling for Peak Traffic

Real-time Analytics

Active Geo-redundancy

Database Consolidation

Resources

Comprehensive knowledge hub for OceanBase.

Blog

Live Demos

Training & Certification

Documentation

Official technical guides, tutorials, API references, and manuals for all OceanBase products.

View All
PRODUCTS

OceanBase Cloud

OceanBase Database

Tools

Connectors and Middleware

QUICK START

OceanBase Cloud

OceanBase Database

BEST PRACTICES

Practical guides for utilizing OceanBase more effectively and conveniently

Company

Learn more about OceanBase – our company, partnerships, and trust and security initiatives.

About OceanBase

Partner

Trust Center

Contact Us

International - English
中国站 - 简体中文
日本 - 日本語
Sign In
Start on Cloud

A unified distributed database ready for your transactional, analytical, and AI workloads.

DEPLOY YOUR WAY

OceanBase Cloud

The best way to deploy and scale OceanBase

OceanBase Enterprise

Run and manage OceanBase on your infra

TRY OPEN SOURCE

OceanBase Community Edition

The free, open-source distributed database

OceanBase seekdb

Open source AI native search database

Customer Stories

Real-world success stories from enterprises across diverse industries.

View All
BY USE CASES

Mission-Critical Transactions

Global & Multicloud Application

Elastic Scaling for Peak Traffic

Real-time Analytics

Active Geo-redundancy

Database Consolidation

Comprehensive knowledge hub for OceanBase.

Blog

Live Demos

Training & Certification

Documentation

Official technical guides, tutorials, API references, and manuals for all OceanBase products.

View All
PRODUCTS
OceanBase CloudOceanBase Database
ToolsConnectors and Middleware
QUICK START
OceanBase CloudOceanBase Database
BEST PRACTICES

Practical guides for utilizing OceanBase more effectively and conveniently

Learn more about OceanBase – our company, partnerships, and trust and security initiatives.

About OceanBase

Partner

Trust Center

Contact Us

Start on Cloud
编组
All Products
    • Databases
    • iconOceanBase Database
    • iconOceanBase Cloud
    • iconOceanBase Tugraph
    • iconInteractive Tutorials
    • iconOceanBase Best Practices
    • Tools
    • iconOceanBase Cloud Platform
    • iconOceanBase Migration Service
    • iconOceanBase Developer Center
    • iconOceanBase Migration Assessment
    • iconOceanBase Admin Tool
    • iconOceanBase Loader and Dumper
    • iconOceanBase Deployer
    • iconKubernetes operator for OceanBase
    • iconOceanBase Diagnostic Tool
    • iconOceanBase Binlog Service
    • Connectors and Middleware
    • iconOceanBase Database Proxy
    • iconEmbedded SQL in C for OceanBase
    • iconOceanBase Call Interface
    • iconOceanBase Connector/C
    • iconOceanBase Connector/J
    • iconOceanBase Connector/ODBC
    • iconOceanBase Connector/NET
icon

OceanBase Database

SQL - V4.2.0

    Download PDF

    OceanBase logo

    The Unified Distributed Database for the AI Era.

    Follow Us
    Products
    OceanBase CloudOceanBase EnterpriseOceanBase Community EditionOceanBase seekdb
    Resources
    DocsBlogLive DemosTraining & Certification
    Company
    About OceanBaseTrust CenterLegalPartnerContact Us
    Follow Us

    © OceanBase 2026. All rights reserved

    Cloud Service AgreementPrivacy PolicySecurity
    Contact Us
    Document Feedback
    1. Documentation Center
    2. OceanBase Database
    3. SQL
    4. V4.2.0
    iconOceanBase Database
    SQL - V 4.2.0
    SQL
    KV
    • V 4.4.2
    • V 4.3.5
    • V 4.3.3
    • V 4.3.1
    • V 4.3.0
    • V 4.2.5
    • V 4.2.2
    • V 4.2.1
    • V 4.2.0
    • V 4.1.0
    • V 4.0.0
    • V 3.1.4 and earlier

    ALTER TENANT

    Last Updated:2023-10-31 11:17:10  Updated
    share
    What is on this page
    Purpose
    Syntax
    Parameters
    Examples

    folded

    share

    Purpose

    You can use this statement to modify tenant information.

    This statement can be executed only in the sys tenant by the administrator of the sys tenant.

    Syntax

    ALTER TENANT {tenant_name | ALL}
        [SET] [tenant_option_list] [opt_global_sys_vars_set];
    
    tenant_option_list:
        tenant_option [, tenant_option ...]
    
    tenant_option:
                COMMENT [=]'string'
              | {CHARACTER SET | CHARSET} [=] charset_name
              | COLLATE [=] collation_name
              | ZONE_LIST [=] (zone [, zone...])
              | PRIMARY_ZONE [=] zone
              | RESOURCE_POOL_LIST [=](pool_name [, pool_name...])
              | DEFAULT TABLEGROUP [=] {NULL | tablegroup_name}
              | {READ ONLY | READ WRITE}
              | LOCALITY [=] 'locality_description'
              | RENAME GLOBAL_NAME TO new_tenant_name
    
    opt_global_sys_vars_set:
          VARIABLES system_var_name = expr [,system_var_name = expr] ...
    

    Parameters

    Parameter Description
    tenant_name The name of the tenant to be modified. ALL indicates to modify all tenants.
    RESOURCE_POOL_LIST The list of resource pools.
    DEFAULT TABLEGROUP The default table group of the tenant. When you set it to NULL, the system disables the default table group.
    COMMENT Modifies the comment.
    CHARACTER SET | CHARSET Modifies the character set of the tenant.

    Note

    The current version does not support this parameter.

    COLLATE Modifies the collation of the tenant.

    Note

    The current version does not support this parameter.

    ZONE_LIST The list of zones to be modified.

    Note

    The current version does not support this parameter.

    PRIMARY_ZONE The primary zone of the tenant.
    READ ONLY | READ WRITE The read-only or read/write attribute of the tenant.

    Note

    The current version does not support this parameter.

    LOCALITY The distribution of replicas across zones. For example, F@z1,F@z2,F@z3 indicates that z1, z2, and z3 are full-featured replicas.
    system_var_name Modifies the system variable value of the tenant.
    RENAME GLOBAL_NAME TO Renames the tenant.

    Examples

    • Change the primary zone of tenant1 to zone2.

      obclient> ALTER TENANT tenant1 primary_zone='zone2';
      Query OK, 0 rows affected
      
    • Do not directly replace the resource pool of the tenant. Otherwise, the following error occurs.

      obclient> ALTER TENANT tenant1 resource_pool_list=('pool2');
      ERROR 1210 (HY000): Incorrect arguments to resource pool list
      

      If you want to scale out the tenant, you can modify the specifications of the resource unit.

      obclient> ALTER RESOURCE UNIT unit1 MAX_CPU 15, MEMORY_SIZE '20G', MAX_IOPS 1280, MIN_CPU=10, MIN_IOPS=1024;
      Query OK, 0 rows affected
      
    • Modify the locality of tenant1 to increase the number of replicas. F indicates a full-featured replica, and B_4 is the name of the zone to be created.

      obclient> CREATE RESOURCE UNIT unit1, MAX_CPU=5, MIN_CPU=2.5, MEMORY_SIZE= 34359738368, MAX_IOPS=10000, MIN_IOPS=5000, LOG_DISK_SIZE=5301023539200;
      Query OK, 0 rows affected
      
      obclient> CREATE RESOURCE POOL pool1 unit='unit1',unit_num=1,zone_list=('B_4');
      Query OK, 0 rows affected
      
      obclient> ALTER TENANT tenant1 resource_pool_list=('sys_pool','sys_pool1');
      Query OK, 0 rows affected
      
      obclient> ALTER TENANT tenant1 locality="F@B_1,F@B_2,F@B_3,F@B_4";
      Query OK, 0 rows affected
      
    • Rename a user tenant.

      obclient> ALTER TENANT tenant1 RENAME GLOBAL_NAME TO tenant101;
      Query OK, 0 rows affected
      

    Previous topic

    ALTER RESOURCE UNIT
    Last

    Next topic

    CREATE RESOURCE POOL
    Next
    What is on this page
    Purpose
    Syntax
    Parameters
    Examples