In the current version, both primary and standby tenants are explicitly created. Therefore, when you delete a tenant, you must explicitly delete the primary and standby tenants.
Considerations
Since primary and standby tenants are independent, deleting a standby tenant does not affect the primary tenant. However, when you delete the primary tenant, if the standby tenant has not been deleted, the synchronization behavior of the standby tenant varies depending on the method used to delete the primary tenant. The specific behavior is as follows:
Delete the primary tenant by using the
DROP TENANTstatementThe deletion status of the primary tenant: If the system tenant has enabled the recycle bin, the deleted primary tenant will be moved to the recycle bin, and the system tenant can further clean up or restore the tenant. If the system tenant has not enabled the recycle bin, the primary tenant will be directly deleted.
The synchronization status of the standby tenant: If the primary tenant is moved to the recycle bin, the synchronization status of the standby tenant is not affected, and it will continue to synchronize logs. If the primary tenant is directly deleted or cleared from the recycle bin by the system tenant, the standby tenant will immediately stop log synchronization after the deletion or cleanup action is performed on the primary tenant.
Delete the primary tenant by using the
DROP TENANT FORCEstatementThe deletion status of the primary tenant: Regardless of whether the system tenant has enabled the recycle bin, the primary tenant is immediately deleted.
The synchronization status of the standby tenant:
In a physical standby tenant scenario based on log archiving, the standby tenant will stop log synchronization after synchronizing all archived logs from the primary tenant.
In a physical standby tenant scenario based on network, the standby tenant will immediately stop log synchronization after the primary tenant is deleted.
Procedure
The method for deleting a standby tenant is the same as that for deleting a primary tenant. Both are completed by using the DROP TENANT statement.
Log in to the
systenant of the cluster where the primary or standby tenant is located as therootuser.Execute the following command to delete the primary or standby tenant.
Delete the tenant by using the
DROP TENANTstatementDROP TENANT tenant_name;Delete the tenant by using the
DROP TENANT FORCEstatementDROP TENANT tenant_name FORCE;
For more information about how to delete a tenant, see Delete a tenant.
