Purpose
The ALTER SYSTEM FLASHBACK STANDBY LOG statement is used to truncate the standby tenant's logs to a specified point. This statement is typically used after a failover to integrate the original primary tenant's standby tenant into the new primary tenant.
Limitations and considerations
Before executing this statement, ensure that the current standby tenant has stopped log synchronization and has no recovery sources.
The standby tenant to be truncated must not have valid replicas on the offline machine.
This statement can only be executed on a standby tenant, and the tenant's
STATUSmust beNORMAL, and itsSWITCHOVER_STATUSmust beNORMALorFLASHBACK_AND_STAY_STANDBY_STATUS.When the
SWITCHOVER_STATUSof the standby tenant isFLASHBACK_AND_STAY_STANDBY_STATUS, log synchronization for the tenant must be stopped, and the recovery source of the tenant cannot be modified.When specifying the log truncation point, the specified point must be greater than or equal to the synchronization point of the standby tenant.
Executing this statement will automatically clear the tenant's service name (
SERVICE_NAME).
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:
- In MySQL mode, the default administrator user is
root. - In Oracle mode, the default administrator user is
SYS.
Syntax
ALTER SYSTEM FLASHBACK STANDBY LOG TO SCN = flashback_log_scn [TENANT = 'tenant_name'];
Parameters
Parameter |
Description |
|---|---|
| flashback_log_scn | Specifies the point to which the standby tenant's logs are truncated. The specified point must be greater than or equal to the synchronization point of the standby tenant. |
| tenant_name | Specifies the standby tenant to be truncated. Only the system tenant needs to specify the tenant when executing this statement. |
Examples
Assume that the confirmed log truncation point is 4611686018427387903. Here is an example of truncating the logs of the standby tenant standby_tenant.
The system tenant truncates the logs of the specified tenant
standby_tenantto the specified point.obclient(root@sys)[(none)]> ALTER SYSTEM FLASHBACK STANDBY LOG TO SCN = 4611686018427387903 TENANT = standby_tenant;The standby tenant truncates its own logs to the specified point.
obclient> ALTER SYSTEM FLASHBACK STANDBY LOG TO SCN = 4611686018427387903;
References
For more information about log truncation, see Failover.
