Purpose
The ALTER SYSTEM FLASHBACK STANDBY LOG statement is used to truncate the standby tenant's logs to a specified point.
Limitations and considerations
Before executing this statement, ensure that the current standby tenant has stopped log synchronization and its restore source is empty.
Standby tenants pending log trimming are not allowed to have any valid replicas on offline machines.
This statement can only be executed on a standby tenant. The standby tenant's
STATUSmust beNORMAL, and itsSWITCHOVER_STATUSmust beNORMALorFLASHBACK_AND_STAY_STANDBY_STATUS.When the standby tenant's
SWITCHOVER_STATUSisFLASHBACK_AND_STAY_STANDBY_STATUS, the standby tenant is not allowed to continue log synchronization, nor is its recovery source allowed to be modified.When specifying a 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
It must be executed by the root user of the sys tenant (root@sys) or the administrator user of a user tenant (root user).
Syntax
ALTER SYSTEM FLASHBACK STANDBY LOG TO SCN = flashback_log_scn [TENANT = 'tenant_name'];
Parameters
Parameter |
Description |
|---|---|
| flashback_log_scn | Specifies the target log position to which log trimming for the standby tenant will stop. The specified log position must be greater than or equal to the synchronization log position of the standby tenant. |
| tenant_name | The system tenant specifies the standby tenant for which log trimming is to be performed. Only the system tenant needs to specify a tenant when executing this statement. |
Examples
Assume the confirmed log trimming checkpoint is 4611686018427387903. The following example shows how to perform log trimming for the standby tenant standby_tenant.
The system tenant truncates the logs of the specified tenant
standby_tenantto a specified point in time.obclient(root@sys)[(none)]> ALTER SYSTEM FLASHBACK STANDBY LOG TO SCN = 4611686018427387903 TENANT = standby_tenant;The standby tenant trims its own logs to a specified point.
obclient> ALTER SYSTEM FLASHBACK STANDBY LOG TO SCN = 4611686018427387903;
References
For detailed operations and descriptions on log truncation, see Failover.