You can use the ALTER SYSTEM ACTIVATE STANDBY statement to activate a standby tenant as the primary tenant after physical restore is completed or in the Physical Standby Database scenario.
After the statement is successfully executed, the role of the standby tenant changes from STANDBY to PRIMARY. For more information about tenant roles, see Overview.
Limitations and considerations
Before you execute this statement, make sure that all log stream replicas of the standby tenant are online. If any replicas are offline, you must wait until the offline replicas are permanently removed.
You can use this statement to activate only one standby tenant as the primary tenant at a time. If you want to activate multiple standby tenants, execute this statement repeatedly.
Required privileges
Only the root user of the sys tenant (root@sys) or the administrator user of a user tenant can execute this statement.
The default administrator user in MySQL mode is
root.The default administrator user in Oracle mode is
SYS.
Syntax
obclient> ALTER SYSTEM ACTIVATE STANDBY TENANT tenant_name;
Parameters
| Parameter | Description |
|---|---|
| tenant_name | The name of the standby tenant to be activated as the primary tenant.
NoticeWhen you execute this statement in the |
Examples
In the Physical Standby Database scenario, log on to the
systenant of the cluster to which the standby tenanttenant1belongs and activate it as the primary tenant. Alternatively, in the physical backup and restore scenario, log on to thesystenant of the cluster to which the restored standby tenanttenant1belongs and activate it as the primary tenant to provide services.obclient [oceanbase]> ALTER SYSTEM ACTIVATE STANDBY TENANT tenant1;In the Physical Standby Database scenario, log on to a standby tenant and activate it as the primary tenant. Alternatively, in the physical backup and restore scenario, log on to a standby tenant and activate it as the primary tenant to provide services.
obclient [SYS]> ALTER SYSTEM ACTIVATE STANDBY;