After physical restore is complete, 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.
Limitations and considerations
All replicas of the standby tenant's log streams must be online before you can execute this command. If any replica of a log stream is offline, you need to wait for the corresponding replica to permanently go offline before executing.
This command can only activate one standby tenant to primary at a time. To activate multiple tenants, you need to repeat the command for each.
Privilege requirements
This statement must be executed by the root user of the sys tenant (root@sys) or the administrator user of a user tenant (root user).
Syntax
ALTER SYSTEM ACTIVATE STANDBY
[TENANT tenant_name]
[VERIFY];
Parameters
Parameter |
Description |
|---|---|
| tenant_name | Specifies the name of the standby tenant to be activated as the primary tenant.
NoticeOnly the system tenant needs to specify the target tenant via the |
| VERIFY | Optional. When this parameter is used, it performs a pre-check to confirm the execution of ACTIVATE STANDBY Check whether the prerequisites for the command are met.
Notice
|
Examples
In a physical standby scenario, the system tenant of the cluster where the standby tenant resides activates standby tenant
tenant1as the primary tenant. Alternatively, in a physical backup and restore scenario, the system tenant of the cluster where the standby tenant resides activates the newly restored standby tenanttenant1as 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;