Purpose
Two log archiving modes are supported: ARCHIVELOG and NOARCHIVELOG. You can use the ALTER SYSTEM ARCHIVELOG statement to enable ARCHIVELOG for a user tenant. You can initiate a log archiving job only for a tenant for which ARCHIVELOG is enabled.
You can use the ALTER SYSTEM NOARCHIVELOG statement to disable ARCHIVELOG. For more information about the ALTER SYSTEM NOARCHIVELOG statement, see NOARCHIVELOG.
Required privileges
You must execute this statement as the root user of the sys tenant (namely root@sys) or as the administrator of a user tenant.
- The default administrator is the
rootuser in MySQL mode. - The default administrator is the
SYSuser in Oracle mode.
Syntax
ALTER SYSTEM ARCHIVELOG [TENANT = {all | tenant_name[, tenant_name...]}] [DESCRIPTION [=] 'description'];
Parameters
| Parameter | Description |
|---|---|
| all | Specifies to enable ARCHIVELOG for all user tenants in the cluster from the sys tenant.
NoticeAll user tenants here are those that already exist in the cluster when the statement is executed. The system does not automatically enable ARCHIVELOG for user tenants created after the statement is executed. |
| tenant_name[, tenant_name...] | The name of the tenant for which ARCHIVELOG is to be enabled from the sys tenant. You can specify multiple tenants separated with commas (,).
NoticeYou must use the |
| description | Optional. The description of the operation. |
Examples
Assume that the current cluster contains three tenants which are respectively named sys, mysql_tenant, and oracle_tenant, and that an archive destination has been configured for the mysql_tenant and oracle_tenant user tenants. You can execute the following statement to enable ARCHIVELOG for the tenants.
Enable ARCHIVELOG for the
mysql_tenanttenant from the sys tenant.obclient [oceanbase]> ALTER SYSTEM ARCHIVELOG TENANT = mysql_tenant;Enable ARCHIVELOG for the
mysql_tenantandoracle_tenanttenants from the sys tenant.obclient [oceanbase]> ALTER SYSTEM ARCHIVELOG TENANT = mysql_tenant;Enable ARCHIVELOG for all user tenants from the sys tenant.
obclient [oceanbase]> ALTER SYSTEM ARCHIVELOG TENANT = all;Enable ARCHIVELOG for the
mysql_tenantororacle_tenanttenant from the current tenant.obclient [oceanbase]> ALTER SYSTEM ARCHIVELOG;