Start a zone

2025-12-09 07:09:36  Updated

You can start a zone to enable all servers in the zone to provide services.

Applicable scenarios

  • If you add a new zone and it is in the INACTIVE state, you can start the zone to use the servers in this zone.

  • If the current zone is isolated due to business reasons and the zone is in the INACTIVE state, you can start the zone to cancel its isolation.

Procedure

  1. Log on to the sys tenant of the cluster as the root user.

    Run the following command to log on. You must replace the related information in the command based on the actual database environment.

    obclient -h10.xx.xx.xx -P2883 -uroot@sys -p***** -A
    

    For more information about how to connect to OceanBase Database, see Overview of the Connect to OceanBase Database chapter in Develop Applications in MySQL Mode and Overview of the Connect to OceanBase Database chapter in Develop Applications in Oracle Mode.

  2. Execute the following statement to start the zone.

    obclient [(none)]> ALTER SYSTEM START ZONE zone_name;
    

    In the statement, zone_name specifies the name of the zone to be started. This statement starts only one zone at a time.

    Here is an example:

    obclient [(none)]> ALTER SYSTEM START ZONE zone4;
    Query OK, 0 rows affected
    
  3. After the statement is executed, you can query the oceanbase.DBA_OB_ZONES to verify whether the zone is started.

    obclient [(none)]> SELECT * FROM oceanbase.DBA_OB_ZONES;
    +-------+----------------------------+----------------------------+--------+-----+----------+-----------+
    | ZONE  | CREATE_TIME                | MODIFY_TIME                | STATUS | IDC | REGION   | TYPE      |
    +-------+----------------------------+----------------------------+--------+-----+----------+-----------+
    | zone1 | 2022-12-20 17:50:17.168745 | 2022-12-20 17:50:40.801054 | ACTIVE | HZ0 | hangzhou | ReadWrite |
    | zone2 | 2022-12-20 17:50:17.168745 | 2022-12-20 17:50:40.809504 | ACTIVE | HZ0 | hangzhou | ReadWrite |
    | zone3 | 2022-12-20 17:50:17.169804 | 2023-01-30 17:34:11.228474 | ACTIVE | HZ1 | hangzhou | ReadWrite |
    | zone4 | 2023-01-06 15:30:30.887362 | 2023-01-31 13:47:56.107429 | ACTIVE | hz1 | hangzhou | ReadWrite |
    +-------+----------------------------+----------------------------+--------+-----+----------+-----------+
    4 rows in set
    

    If the status of the zone changes from INACTIVE to ACTIVE, the zone is successfully started.

    For more information about the oceanbase.DBA_OB_ZONES view, see oceanbase.DBA_OB_ZONES.

More information

For more zone-related O&M operations, see the following topics:

Contact Us