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.
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 a specified tenant in the cluster from the sys tenant.
Log on 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];After the statement is executed,
ARCHIVELOGis disabled for themysql_tenantandoracle_tenanttenants in this example. You can query theoceanbase.DBA_OB_TENANTSview in 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, after you execute this statement, only the
mysql_tenanttenant enters theNOARCHIVELOGmode. 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: 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 on to the database as a tenant administrator.
In this example, you can log on to the
mysql_tenanttenant as therootuser, or log on 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 in this 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