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.3.5

    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.3.5
    iconOceanBase Database
    SQL - V 4.3.5
    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

    DROP RESOURCE UNIT

    Last Updated:2026-04-09 02:53:55  Updated
    share
    What is on this page
    Purpose
    Syntax
    Parameters
    Examples
    References

    folded

    share

    Purpose

    This statement is used to drop a resource unit.

    Notice

    Before dropping a resource unit, make sure that the resource unit is not in use. If the resource unit is in use, you must first remove it from the resource pool before dropping it.

    Syntax

    DROP RESOURCE UNIT unit_name;
    

    Parameters

    Parameter Description
    unit_name The name of the resource unit to be dropped.

    Examples

    • If a resource unit is not assigned to a resource pool, you can directly drop it.

      obclient> DROP RESOURCE UNIT unit1;
      Query OK, 0 rows affected
      
    • If a resource unit is assigned to a resource pool, you cannot directly drop it. You must first remove it from the resource pool before dropping it.

      For example, in the following example, the resource unit unit1 is assigned to the resource pool pool1.

      obclient> CREATE RESOURCE POOL pool1 UNIT='unit1', UNIT_NUM=1, ZONE_LIST=('zone2');
      

      When you attempt to directly drop the resource unit unit1, an error is returned.

      obclient> DROP RESOURCE UNIT unit1;
      ERROR 4634 (HY000): resource unit 'UNIT1' is referenced by some resource pool
      

      If you still need to remove unit1 from the resource pool pool1, you can create a new resource unit unit2, assign unit2 to pool1, and then drop unit1. Here is an example:

      1. Create a new resource unit unit2.

        obclient> CREATE RESOURCE UNIT unit2 MAX_CPU 4, MEMORY_SIZE '5G', MAX_IOPS 1280,LOG_DISK_SIZE '10G', MIN_CPU=4, MIN_IOPS=1024;
        
      2. Remove unit1 from the resource pool pool1.

        obclient> ALTER RESOURCE POOL pool1 UNIT='';
        

        Notice

        Each execution of the ALTER RESOURCE POOL command can only add or remove one resource unit from the resource pool. Therefore, you need to first remove unit1 and then add unit2.

      3. Assign unit2 to the resource pool pool1.

        obclient> ALTER RESOURCE POOL pool1 UNIT='unit2';
        
      4. Drop the resource unit unit1. The drop operation is successful.

        obclient> DROP RESOURCE UNIT unit1;
        Query OK, 0 rows affected
        
    • If you want to drop a resource unit that is assigned to a resource pool and also clean up the resource pool, you must first drop the resource pool and then drop the resource unit.

      For example, in the following example, the resource unit unit1 is assigned to the resource pool pool1.

      obclient> CREATE RESOURCE POOL pool1 UNIT='unit1', UNIT_NUM=1, ZONE_LIST=('zone2');
      

      When you attempt to directly drop the resource unit unit1, an error is returned.

      obclient> DROP RESOURCE UNIT unit1;
      ERROR 4634 (HY000): resource unit 'UNIT1' is referenced by some resource pool
      

      First, drop the resource pool pool1, and then drop the resource unit unit1. The drop operation is successful.

      obclient> DROP RESOURCE POOL pool1;
      Query OK, 0 rows affected
      
      obclient> DROP RESOURCE UNIT unit1;
      Query OK, 0 rows affected
      

    References

    Delete a resource specification

    Previous topic

    DROP RESOURCE POOL
    Last

    Next topic

    DROP TENANT
    Next
    What is on this page
    Purpose
    Syntax
    Parameters
    Examples
    References