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 of each other, deleting a standby tenant does not affect the primary tenant. However, when you delete a primary tenant, if the standby tenant has not been deleted yet, the standby tenant's synchronization behavior varies slightly depending on how you delete the primary tenant. The specific behaviors are as follows:
Delete a 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 later 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.
Delete a 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 database scenario based on log archiving, the standby tenant stops log synchronization after synchronizing all archived logs from the primary tenant.
In a physical standby database scenario based on network, the standby tenant immediately stops 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 command.
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 a tenant by using the
DROP TENANTstatementDROP TENANT tenant_name;Delete a tenant by using the
DROP TENANT FORCEstatementDROP TENANT tenant_name FORCE;
For more information about how to delete a tenant, see Delete a tenant.