In this version of OceanBase Database, Physical Standby Database is implemented by using independent tenants, and standby tenants are explicitly created by using the RESTORE statement. Therefore, you must drop a primary or standby tenant in an explicit manner.
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 sys tenant, 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 the sys tenant, 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 sys tenant, the standby tenant stops synchronizing logs 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 sys tenant.
Synchronization behavior of the standby tenant: The standby tenant stops log synchronization after it synchronizes all archive logs of the primary tenant.
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 about how to drop a tenant, see Delete a tenant.