Purpose
The log archiving mode is divided into two types: archive mode (ARCHIVELOG) and non-archiving mode (NOARCHIVELOG). After you enable the log archiving mode, you can use the ALTER SYSTEM NOARCHIVELOG statement to disable the archiving mode for a user tenant.
Limitations and considerations
Before you use the ALTER SYSTEM NOARCHIVELOG statement to disable the archiving mode, if there are ongoing or paused log archiving tasks in the current tenant, the system will automatically stop these archiving tasks after the archiving mode is disabled.
Privilege requirements
The root user of the sys tenant (root@sys) or the administrator of each tenant must execute this statement. Specifically:
- The default administrator in MySQL-compatible mode is the
rootuser. - The default administrator in Oracle-compatible mode is the
SYSuser.
Syntax
ALTER SYSTEM NOARCHIVELOG [TENANT = {all | tenant_name[, tenant_name...]}] [DESCRIPTION [=] 'description'];
Parameters
| Parameter | Description |
|---|---|
| all | The system tenant disables the archiving mode for all user tenants in the cluster. |
| tenant_name[, tenant_name...] | The system tenant specifies the tenant name to disable the archiving mode. You can specify multiple tenants, separated by commas (,).
NoticeOnly the system tenant needs to specify the |
| description | The description of the operation, which is optional. |
Examples
Assume that the current cluster has three tenants: sys, mysql_tenant, and oracle_tenant. Both mysql_tenant and oracle_tenant have enabled the archiving mode. You can use the following statements to disable the archiving mode for the tenants.
The system tenant disables the archiving mode for the
mysql_tenanttenant.obclient [oceanbase]> ALTER SYSTEM NOARCHIVELOG TENANT = mysql_tenant;The system tenant disables the archiving mode for the
mysql_tenantandoracle_tenanttenants.obclient [oceanbase]> ALTER SYSTEM NOARCHIVELOG TENANT = mysql_tenant, oracle_tenant;The system tenant disables the archiving mode for all user tenants.
obclient [oceanbase]> ALTER SYSTEM NOARCHIVELOG TENANT = all;The
mysql_tenantandoracle_tenanttenants disable the archiving mode for themselves.obclient [oceanbase]> ALTER SYSTEM NOARCHIVELOG;