After you enable ARCHIVELOG for a tenant, you can disable ARCHIVELOG in the same way. After you disable ARCHIVELOG for a tenant, the system automatically stops the ongoing and suspended archiving jobs of the tenant.
Notice
This feature prevents a log archiving job from being stuck in the `STOPPING` state. It allows you to stop a log archiving job even when the archive destination is unavailable. Log consumption modules can also normally consume logs when log archiving is forcibly stopped.
Background information
Assume that the current cluster has three tenants: sys, mysql_tenant, and oracle_tenant, and that ARCHIVELOG is enabled for mysql_tenant and oracle_tenant.
Disable ARCHIVELOG for tenants from the sys tenant
You can disable ARCHIVELOG for all tenants or one or more specified tenants in the cluster from the sys tenant.
Log in to the
systenant of the cluster as therootuser.Execute the following statement to disable
ARCHIVELOG:Disable
ARCHIVELOGfor all tenants in the clusterTo disable
ARCHIVELOGfor all tenants in the cluster, execute the following statement:obclient [(none)]> ALTER SYSTEM NOARCHIVELOG [TENANT = ALL];In this example,
ARCHIVELOGis disabled for themysql_tenantandoracle_tenanttenants after the statement is executed. You can query theoceanbase.DBA_OB_TENANTSview from thesystenant for the archiving modes of all tenants in the cluster.obclient [(none)]> SELECT TENANT_NAME, LOG_MODE FROM oceanbase.DBA_OB_TENANTS WHERE TENANT_TYPE='USER'\G *************************** 1. row *************************** TENANT_NAME: mysql_tenant LOG_MODE: NOARCHIVELOG *************************** 2. row *************************** TENANT_NAME: oracle_tenant LOG_MODE: NOARCHIVELOG 2 rows in setDisable
ARCHIVELOGfor a specified tenant in the clusterTo disable
ARCHIVELOGfor a specified tenant without affecting other tenants in the cluster, execute the following statement:obclient [(none)]> ALTER SYSTEM NOARCHIVELOG TENANT = mysql_tenant;Note
If you specify multiple tenants, separate the tenant names with commas (,).
In this example, only the
mysql_tenanttenant enters theNOARCHIVELOGmode after you execute the statement. You can query theoceanbase.DBA_OB_TENANTSview from the tenant for the archiving modes of all tenants in the cluster.obclient [(none)]> SELECT TENANT_NAME, LOG_MODE FROM oceanbase.DBA_OB_TENANTS WHERE TENANT_TYPE = 'USER'\G *************************** 1. row *************************** TENANT_NAME: mysql_tenant LOG_MODE: NOARCHIVELOG *************************** 2. row *************************** TENANT_NAME: oracle_tenant LOG_MODE: ARCHIVELOG 2 rows in set
Disable ARCHIVELOG for a user tenant from the current tenant
You can disable ARCHIVELOG for a user tenant from the current tenant without affecting other tenants.
Log in to the database as a tenant administrator.
In this example, you can log in to the
mysql_tenanttenant as therootuser, or to theoracle_tenanttenant as theSYSuser.Execute the following statement to disable
ARCHIVELOG:obclient [xxx]> ALTER SYSTEM NOARCHIVELOG;After the statement is executed, you can query the
DBA_OB_TENANTSview from the tenant for its archiving mode.obclient [SYS]> SELECT TENANT_NAME, LOG_MODE FROM DBA_OB_TENANTS\G *************************** 1. row *************************** TENANT_NAME: oracle_tenant LOG_MODE: NOARCHIVELOG 1 rows in set