You can start a zone to allow all servers in the zone to provide services.
Background information
You can start a zone in the following scenarios:
You have added a zone whose status is
INACTIVEand want to use the servers in the zone.The zone is isolated for business reasons and its status is
INACTIVE. You want to start the zone to remove the isolation.
Procedure
Log in to the
systenant of the cluster as therootuser.The following example shows how to connect to the database. Replace the actual environment variables with the values in your environment.
obclient -h10.xx.xx.xx -P2883 -uroot@sys#obdemo -p***** -AFor more information about how to connect to the database, see Overview of database connections (MySQL mode) and Overview of database connections (Oracle mode).
Execute the following statement to start the zone.
The statement is as follows:
obclient [(none)]> ALTER SYSTEM START ZONE zone_name;In this statement,
zone_namespecifies the name of the zone to be started. You can start only one zone at a time.Here is an example:
obclient [(none)]> ALTER SYSTEM START ZONE zone4; Query OK, 0 rows affectedAfter the operation is completed, you can query the
DBA_OB_ZONESview to confirm the result.obclient [(none)]> SELECT * FROM oceanbase.DBA_OB_ZONES;The query result is as follows:
+-------+----------------------------+----------------------------+--------+-----+----------+-----------+ | 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 setFrom the query result, you can see that the status of the zone changes from
INACTIVEtoACTIVE, indicating that the zone is started.For more information about the
DBA_OB_ZONESview, see oceanbase.DBA_OB_ZONES.
References
For more information about zone management, see the following topics:
