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
INACTIVEstate, 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
INACTIVEstate, you can start the zone to cancel its isolation.
Procedure
Log on to the
systenant of the cluster as therootuser.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***** -AFor 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.
Execute the following statement to start the zone.
obclient [(none)]> ALTER SYSTEM START ZONE zone_name;In the statement,
zone_namespecifies 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 affectedAfter the statement is executed, you can query the
oceanbase.DBA_OB_ZONESto 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 setIf the status of the zone changes from
INACTIVEtoACTIVE, the zone is successfully started.For more information about the
oceanbase.DBA_OB_ZONESview, see oceanbase.DBA_OB_ZONES.
More information
For more zone-related O&M operations, see the following topics: