In OceanBase Database, primary and standby tenants are explicitly created and therefore must be explicitly dropped.
Considerations
The primary and standby tenants are independent of each other. When you drop a standby tenant, the primary tenant is not affected. However, if a standby tenant is running when you drop the primary tenant, the synchronization behavior of the standby tenant depends on which of the following methods is used to drop the primary tenant:
Drop the primary tenant by using the
DROP TENANTstatementBehavior of the primary tenant: If you have enabled the recycle bin feature for the
systenant, the dropped primary tenant is removed to the recycle bin, and can be purged or restored later. If you have not enabled the recycle bin feature for thesystenant, the dropped primary tenant is directly deleted.Synchronization behavior of the standby tenant: If the primary tenant is dropped to the recycle bin, the standby tenant continues to synchronize logs. If the primary tenant is deleted or is purged from the recycle bin of the
systenant, the standby tenant immediately stops log synchronization when it detects the deletion or purging action.
Drop the primary tenant by using the
DROP TENANT FORCEstatementBehavior of the primary tenant: The primary tenant is immediately deleted regardless of whether you have enabled the recycle bin feature for the
systenant.Synchronization behavior of the standby tenant:
In the Physical Standby Database solution based on log archiving, the standby tenant stops log synchronization after it synchronizes all archived logs of the primary tenant.
In the network-based Physical Standby Database solution, the standby tenant immediately stops log synchronization after the primary tenant is deleted.
Procedure
You can drop a primary or standby tenant by using the DROP TENANT statement. To do so, perform the following steps:
Log on as the
root userto the primary tenant or thesystenant of the cluster where the standby tenant resides.Drop the primary or standby tenant by using either of the following methods:
Drop the tenant by using the
DROP TENANTstatementDROP TENANT tenant_name;Drop the tenant by using the
DROP TENANT FORCEstatementDROP TENANT tenant_name FORCE;
For more information, see Drop a tenant.