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.
Notice
To prevent the status of archiving jobs from remaining in the STOPPING state and failing to be closed, archiving jobs can be properly closed even when the archive media is unavailable. Accordingly, the log consumption module can also correctly consume logs when archiving is forcibly closed.
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 in to the
systenant of the cluster as therootuser.Execute the following statement to disable
ARCHIVELOG.Disable
ARCHIVELOGfor all tenants in the clusterThis method disables
ARCHIVELOGfor all tenants in the cluster.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 clusterThis method disables
ARCHIVELOGonly for the specified tenant and does not affect other tenants in the cluster.obclient [(none)]> ALTER SYSTEM NOARCHIVELOG TENANT = mysql_tenant;Note
If you specify multiple tenants, separate the tenant names with commas (,).
After the statement is successfully executed, in this example,
ARCHIVELOGis disabled formysql_tenant. You can query theoceanbase.DBA_OB_TENANTSview in 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 log in to theoracle_tenanttenant as theSYSuser.Execute the following statement to disable
ARCHIVELOG.obclient [xxx]> ALTER SYSTEM NOARCHIVELOG;After the statement is successfully executed, you can directly 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
