MIGRATE UNIT

2025-11-19 10:08:12  Updated

Purpose

You can use this statement to migrate resource units.

You can execute this statement only in the sys tenant.

To balance the resource distribution among multiple OBServer nodes in a zone, you can adjust the resource distribution among tenants to balance the resource usage in the cluster. Before you migrate a unit, you must disable automatic load balancing by using the following syntax:

obclient> ALTER SYSTEM SET enable_rebalance = false;

For more information about the preceding parameter, see "System parameters" in OceanBase Database Reference Guide.

Syntax

alter_system_unit_stmt:
    ALTER SYSTEM MIGRATE
    UNIT [=] unit_id DESTINATION [=] ip_port

unit_id:
    INT_VALUE

Parameters

Parameter Description
unit_id The unit ID.
ip_port The address of the destination server to which the resource unit is migrated.

Examples

Migrate the resource unit whose unit_id is 1001 to the OBServer node whose IP address is xxx.xxx.xx.xx1.

obclient> ALTER SYSTEM MIGRATE UNIT = 1001 DESTINATION = 'xxx.xxx.xx.xx1:xxxx';
Query OK, 0 rows affected

Contact Us