Purpose
This statement is used to control log replay for a standby tenant. After a restore operation, the tenant becomes a standby tenant. You can execute this command to continue log replay from the source of the log archive to a specified timestamp or SCN, or to perform continuous, endless replay. You can also cancel an ongoing log replay.
Syntax
ALTER SYSTEM RECOVER STANDBY [TENANT tenant_name]
{ UNTIL TIME = 'timestamp' | UNTIL SCN = scn | UNTIL UNLIMITED | CANCEL };
Parameters
Parameter |
Description |
|---|---|
| TENANT tenant_name | Optional. When executed under the system tenant, specify the name of the standby tenant to operate on. When executed within a standby tenant itself, this parameter is not required. |
| UNTIL TIME = 'timestamp' | Replay logs to a specified timestamp, including that timestamp. The recommended timestamp format is 'YYYY-MM-DD HH:MM:SS.ffffff'. |
| UNTIL SCN = scn | Replay logs to the specified SCN and include that point. |
| UNTIL UNLIMITED | No end point. Logs are continuously replayed from the archive source. |
| CANCEL | Aborts the ongoing log replay for the current standby tenant. |
Examples
System tenant specifies standby tenant for log replay
When executing under the system tenant, you must use TENANT to specify the standby tenant name.
Replay logs to a specified timestamp.
obclient> ALTER SYSTEM RECOVER STANDBY TENANT tenant_name UNTIL TIME = '2024-01-01 00:00:00.000000';Replay logs to a specified SCN.
obclient> ALTER SYSTEM RECOVER STANDBY TENANT tenant_name UNTIL SCN = 123456;Continuously replay logs without an end point.
obclient> ALTER SYSTEM RECOVER STANDBY TENANT tenant_name UNTIL UNLIMITED;Cancel log replay.
obclient> ALTER SYSTEM RECOVER STANDBY TENANT tenant_name CANCEL;
Standby tenant triggers its own log replay
The administrator user of the standby tenant can directly execute it for the current tenant without specifying TENANT.
Replay logs to a specified timestamp.
obclient> ALTER SYSTEM RECOVER STANDBY UNTIL TIME = '2024-01-01 00:00:00.000000';Cancel log replay.
obclient> ALTER SYSTEM RECOVER STANDBY CANCEL;
References
- For more information about how to use segmented log replay and view the replay progress, see Segmented log replay for standby tenants.
- For the primary/standby switchover command, see SWITCHOVER.
