Drop a primary or standby tenant

2023-10-31 11:17:10  Updated

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 TENANT statement

    • Behavior 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 immediately stops log synchronization when it detects the deletion or purging action.

  • Drop the primary tenant by using the DROP TENANT FORCE statement

    • Behavior 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:

      • 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:

  1. Log on as the root user to the primary tenant or the sys tenant of the cluster where the standby tenant resides.

  2. Drop the primary or standby tenant by using either of the following methods:

    • Drop the tenant by using the DROP TENANT statement

      DROP TENANT tenant_name;
      
    • Drop the tenant by using the DROP TENANT FORCE statement

      DROP TENANT tenant_name FORCE;
      

For more information, see Drop a tenant.

References

Contact Us