In the current version of OceanBase Database, since both primary and standby tenants are explicitly created, they need to be explicitly dropped.
Considerations
Since primary and standby tenants are independent of each other, dropping the standby tenant will not affect the primary tenant. However, when dropping the primary tenant, if the standby tenant has not been dropped yet, the synchronization behavior of the standby tenant will be slightly different depending on how the primary tenant is dropped. The details are as follows:
If the primary tenant is dropped using the
DROP TENANTstatement:Dropping status of the primary tenant:
- If the system tenant has enabled the recycle bin feature, the dropped primary tenant will be moved to the recycle bin, and the system tenant can purge or restore the tenant later.
- If the system tenant has not enabled the recycle bin feature, the primary tenant will be dropped directly.
Synchronization status of the standby tenant:
- If the primary tenant is moved to the recycle bin, the synchronization status of the standby tenant will not be affected, and it will continue to synchronize logs.
- If the primary tenant is dropped directly or purged from the recycle bin by the system tenant, the standby tenant will immediately stop log synchronization upon detection of the dropping or purging action.
If the primary tenant is dropped using the
DROP TENANT FORCEstatement:Dropping status of the primary tenant: The primary tenant will be dropped immediately regardless of whether the system tenant has enabled the recycle bin feature.
Synchronization status of the standby tenant:
In the case of log archiving-based physical standby database, the standby tenant will stop log synchronization after synchronizing all archived logs from the primary tenant.
In the case of network-based physical standby database, the standby tenant will immediately stop log synchronization after the primary tenant is deleted.
Procedure
The procedure for dropping the standby tenant is the same as that for dropping the primary tenant. Both are done using the DROP TENANT statement. The detailed steps are as follows:
Log in to the primary tenant or the
systenant of the cluster where the standby tenant is located, using theroot user.Drop the primary or standby tenant using the following methods:
Using the
DROP TENANTstatementDROP TENANT tenant_name;Using the
DROP TENANT FORCEstatementDROP TENANT tenant_name FORCE;
For more information, see Drop a tenant.