After physical recovery is completed or before switching to the standby tenant in a physical standby scenario, you can use the ALTER SYSTEM ACTIVATE STANDBY command to activate the standby tenant as the primary tenant.
After the ALTER SYSTEM ACTIVATE STANDBY command is successfully executed, the tenant role of the original standby tenant changes from STANDBY to PRIMARY. For more information about tenant roles, see Overview of tenant roles.
Limitations and considerations
Before you execute this command, all replicas of the standby tenant's log streams must be online. If any replica is offline, you must wait for it to permanently go offline before executing the command.
This command can only activate one standby tenant as the primary tenant at a time. If you need to activate multiple tenants, you must execute the command repeatedly.
Privilege requirements
The command must be executed by the root user of the sys tenant (root@sys) or the administrator user of each tenant. Specifically:
In MySQL mode, the default administrator user is
root.In Oracle mode, the default administrator user is
SYS.
Syntax
ALTER SYSTEM ACTIVATE STANDBY
[TENANT tenant_name]
[VERIFY];
Parameters
| Parameter | Description |
|---|---|
| tenant_name | The name of the standby tenant to be activated as the primary tenant.
NoticeOnly the system tenant needs to specify the |
| VERIFY | Optional. When this parameter is used, it performs a preliminary check to confirm whether the necessary prerequisites for executing the ACTIVATE STANDBY command are met.
Notice
|
Examples
In a physical standby scenario, the system tenant of the cluster where the standby tenant
tenant1is located activates it as the primary tenant. Alternatively, in a physical backup and restore scenario, the system tenant of the cluster where the standby tenanttenant1is located activates it as the primary tenant to provide services.obclient [oceanbase]> ALTER SYSTEM ACTIVATE STANDBY TENANT tenant1;In a physical standby scenario, the standby tenant activates itself as the primary tenant. Alternatively, in a physical backup and restore scenario, the standby tenant activates itself as the primary tenant to provide services.
obclient [SYS]> ALTER SYSTEM ACTIVATE STANDBY;
