Drop primary and standby tenants

2024-06-28 05:30:29  Updated

In the current version of OceanBase Database, since both primary and standby tenants are explicitly created, they need to be explicitly dropped.

Considerations

Since primary and standby tenants are independent of each other, dropping the standby tenant will not affect the primary tenant. However, when dropping the primary tenant, if the standby tenant has not been dropped yet, the synchronization behavior of the standby tenant will be slightly different depending on how the primary tenant is dropped. The details are as follows:

  • If the primary tenant is dropped using the DROP TENANT statement:

    • Dropping status of the primary tenant:

      • If the system tenant has enabled the recycle bin feature, the dropped primary tenant will be moved to the recycle bin, and the system tenant can purge or restore the tenant later.
      • If the system tenant has not enabled the recycle bin feature, the primary tenant will be dropped directly.
    • Synchronization status of the standby tenant:

      • If the primary tenant is moved to the recycle bin, the synchronization status of the standby tenant will not be affected, and it will continue to synchronize logs.
      • If the primary tenant is dropped directly or purged from the recycle bin by the system tenant, the standby tenant will immediately stop log synchronization upon detection of the dropping or purging action.
  • If the primary tenant is dropped using the DROP TENANT FORCE statement:

    • Dropping status of the primary tenant: The primary tenant will be dropped immediately regardless of whether the system tenant has enabled the recycle bin feature.

    • Synchronization status of the standby tenant:

      • In the case of log archiving-based physical standby database, the standby tenant will stop log synchronization after synchronizing all archived logs from the primary tenant.

      • In the case of network-based physical standby database, the standby tenant will immediately stop log synchronization after the primary tenant is deleted.

Procedure

The procedure for dropping the standby tenant is the same as that for dropping the primary tenant. Both are done using the DROP TENANT statement. The detailed steps are as follows:

  1. Log in to the primary tenant or the sys tenant of the cluster where the standby tenant is located, using the root user .

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

    • Using the DROP TENANT statement

      DROP TENANT tenant_name;
      
    • Using the DROP TENANT FORCE statement

      DROP TENANT tenant_name FORCE;
      

For more information, see Drop a tenant.

References

Contact Us