Purpose
The SET LOG_ARCHIVE_DEST_STATE statement is used to set the status of the archive destination.
Privilege requirements
This statement must be executed by the root user of the sys tenant (root@sys) or the administrator user of each tenant. Specifically:
- The default administrator user in MySQL-compatible mode is the
rootuser. - The default administrator user in Oracle-compatible mode is the
SYSuser.
Syntax
ALTER SYSTEM SET LOG_ARCHIVE_DEST_STATE={'ENABLE' | 'DEFER'} [TENANT = tenant_name];
Parameters
| Parameter | Description |
|---|---|
| 'ENABLE' | 'DEFER' | Specifies the status of the archive destination:
|
| tenant_name | The name of the tenant for which the archive destination status is to be set. Only one tenant can be specified per statement.
NoticeOnly the system tenant needs to specify the target tenant using the |
Examples
Assume that the archive destination has been configured for the mysql_tenant tenant. Here are some examples:
The system tenant pauses log archiving for the
mysql_tenanttenant at the destination.obclient [oceanbase]> ALTER SYSTEM SET LOG_ARCHIVE_DEST_STATE = 'DEFER' TENANT = mysql_tenant;The
mysql_tenanttenant starts log archiving at the destination.obclient [oceanbase]> ALTER SYSTEM SET LOG_ARCHIVE_DEST_STATE = 'ENABLE';