Purpose
After physical restore is completed or a physical standby database is created, you can use this statement to specify a log restore end point for the standby tenant so that logs can be replayed by range or continuously to the standby tenant.
Required privileges
Only the root user of the sys tenant (root@sys) or the administrator user of a user tenant can execute this statement.
- The default administrator user in MySQL mode is
root. - The default administrator user in Oracle mode is
SYS.
Syntax
ALTER SYSTEM RECOVER STANDBY
[TENANT [=] tenant_name] UNTIL { TIME='timestamp' | SCN=scn_no | UNLIMITED };
Parameters
| Parameter | Description |
|---|---|
| tenant_name | The name of the standby tenant for which you want to restore logs. This parameter is used in the sys tenant. You can specify only one standby tenant at a time. If you want to specify multiple tenants, execute this statement repeatedly.
NoticeWhen you execute this statement in the |
| timestamp | The inclusive timestamp up to which logs can be restored to the standby tenant. Join TIME and the value with an equal sign (=). |
| scn_no | The inclusive system change number (SCN) up to which logs can be restored to the standby tenant. Join SCN and the value with an equal sign (=). |
| UNLIMITED | Indicates that there is no end point for restore. In this case, archive logs of the source tenant are continuously replayed to the standby tenant. For the Physical Standby Database scenario, this parameter indicates that the standby tenant is in continuous synchronization mode. |
Examples
systenantIn the backup and restore scenario, log in to the
systenant and specify to replay logs for the standby tenantrestore_oracle_tenantto the timestamp'2023-06-01 00:00:00'.obclient [oceanbase]> ALTER SYSTEM RECOVER STANDBY TENANT restore_oracle_tenant UNTIL TIME='2023-06-01 00:00:00';In the Physical Standby Database scenario, log in to the
systenant and enable continuous synchronization for the standby tenantrestore_oracle_tenant.obclient [oceanbase]> ALTER SYSTEM RECOVER STANDBY TENANT restore_oracle_tenant UNTIL UNLIMITED;
User tenant
In the backup and restore scenario, log in to the standby tenant
restore_oracle_tenantand specify to replay logs for the current tenant to'2023-06-01 00:00:00'.obclient [oceanbase]> ALTER SYSTEM RECOVER STANDBY UNTIL TIME='2023-06-01 00:00:00';In the Physical Standby Database scenario, log in to the standby tenant
restore_oracle_tenantand enable continuous synchronization for the current tenant.obclient [oceanbase]> ALTER SYSTEM RECOVER STANDBY UNTIL UNLIMITED;