After you complete the preparations, you can enable log archiving based on the business scenario.
Prerequisites
Before you enable log archiving, make sure that the log archiving state machine of the tenant for which log archiving is to be enabled is in the STOP state.
Background
Assume that the current cluster contains three tenants: sys, mysql_tenant, and oracle_tenant, and that log archiving preparations have been made for the mysql_tenant and oracle_tenant tenants.
Initiate log archiving from the sys tenant
You can initiate log archiving for all tenants or a specified tenant in the cluster from the sys tenant.
Log on to the
systenant of a cluster as therootuser.Execute the following statement to initiate log archiving.
Initiate log archiving for all tenants in the cluster
The following statement will initiate log archiving for all tenants in the cluster. Note that the system will not automatically initiate log archiving for tenants created after this operation.
obclient [(none)]> ALTER SYSTEM ARCHIVELOG TENANT=ALL;In this example, the system initiates log archiving for the
mysql_tenantandoracle_tenanttenants in the cluster.Initiate log archiving for a specified tenant in the cluster
You can initiate log archiving for a specified tenant without affecting other tenants in the cluster.
Execute the following statement to initiate log archiving for the
mysql_tenanttenant:obclient [(none)]> ALTER SYSTEM ARCHIVELOG TENANT=MYSQL_TENANT;Note:
If you specify multiple tenants, separate the tenant names with commas (
,).After the statement is executed, the system initiates log archiving for the
mysql_tenanttenant.
After you enable log archiving, the system organizes and manages archived log data based on pieces.
Initiate log archiving for a user tenant
You can initiate log archiving for a user 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 to theoracle_tenanttenant as theSYSuser.Execute the following statement to enable log archiving:
obclient [xxx]> ALTER SYSTEM ARCHIVELOG;