Purpose
The log archiving mode is divided into two types: archive (ARCHIVELOG) and non-archive (NOARCHIVELOG) modes. After enabling log archiving, you can use the ALTER SYSTEM NOARCHIVELOG statement to disable archive mode for user tenants.
Limitations and considerations
Before you disable archiving mode by using the ALTER SYSTEM NOARCHIVELOG statement, if there are any ongoing or paused log archive tasks for the current tenant, the system will automatically stop these archive tasks after archiving mode is disabled.
Privilege requirements
This statement must be executed by the root user of the sys tenant (root@sys) or the administrator user of a user tenant (root user).
Syntax
ALTER SYSTEM NOARCHIVELOG [TENANT = {all | tenant_name[, tenant_name...]}] [DESCRIPTION [=] 'description'];
Parameters
Parameter |
Description |
|---|---|
| all | The system tenant disables archiving mode for all user tenants in the cluster. |
| tenant_name[, tenant_name...] | The system tenant specifies the tenant names whose archiving mode is to be disabled. Multiple tenants can be specified, separated by commas (,).
NoteOnly the system tenant needs to specify the target tenant via the |
| description | Optional. Specifies the description of the operation. |
Examples
Assume that the current cluster has three tenants: sys, mysql_tenant, and mysql_tenant1. Both user tenants mysql_tenant and mysql_tenant1 have archive mode enabled. You can use the following statements to enable archive mode for a tenant.
The system tenant has disabled archiving mode for the
mysql_tenanttenant.obclient [oceanbase]> ALTER SYSTEM NOARCHIVELOG TENANT = mysql_tenant;The system tenant has disabled archiving mode for tenants
mysql_tenantandmysql_tenant1.obclient [oceanbase]> ALTER SYSTEM NOARCHIVELOG TENANT = mysql_tenant, mysql_tenant1;The system tenant disables archiving mode for all user tenants.
obclient [oceanbase]> ALTER SYSTEM NOARCHIVELOG TENANT = all;The user tenants
mysql_tenantandmysql_tenant1have archive mode disabled for the current tenant.obclient [oceanbase]> ALTER SYSTEM NOARCHIVELOG;
References
Stop archiving mode