After a restore succeeded, the restored tenant is a standby tenant. You can execute the RECOVER statement to proceed to log replay from the log archive source specified during the restore.
Background
Physical restore is associated with Physical Standby Database. A physically restored tenant serves as a standby tenant. You can change its role to PRIMARY based on your business needs.
Prerequisites
The restore succeeded. For more information about how to view the restore result, see Query the restore result.
Replay logs to a standby tenant from the sys tenant
Log on to the
systenant of the cluster as therootuser.Execute the following statement to replay logs.
Replay logs to the specified timestamp.
obclient [(none)]> ALTER SYSTEM RECOVER STANDBY TENANT tenant_name UNTIL TIME='timestamp';Replay logs to the specified SCN.
obclient [(none)]> ALTER SYSTEM RECOVER STANDBY TENANT tenant_name UNTIL SCN=scn;Continuously replay logs from the archive source without specifying the end point.
obclient [(none)]> ALTER SYSTEM RECOVER STANDBY TENANT tenant_name UNTIL UNLIMITED;Note
This statement allows you to specify only one standby tenant at a time. To perform this operation on multiple tenants, execute this statement repeatedly.
(Optional) Execute the following statement to cancel log replay for a standby tenant.
obclient [(none)]> ALTER SYSTEM RECOVER STANDBY TENANT tenant_name CANCEL;
Initiate log replay from a standby tenant
You can initiate log replay from a standby tenant only for itself.
Log on to the database as an administrator of the standby tenant.
Note
The administrator user is
rootfor a tenant in MySQL mode andSYSfor a tenant in Oracle mode.Execute the following statement to replay logs.
Replay logs to the specified timestamp.
obclient [(none)]> ALTER SYSTEM RECOVER STANDBY UNTIL TIME='timestamp';Replay logs to the specified SCN.
obclient [(none)]> ALTER SYSTEM RECOVER STANDBY UNTIL SCN=scn;Continuously replay logs from the archive source without specifying the end point.
obclient [(none)]> ALTER SYSTEM RECOVER STANDBY UNTIL UNLIMITED;Note
This statement allows you to specify only one standby tenant at a time. To perform this operation on multiple tenants, execute this statement repeatedly.
(Optional) Execute the following statement to cancel log replay for a standby tenant.
obclient [(none)]> ALTER SYSTEM RECOVER STANDBY CANCEL;
For more information about the parameters in the statement, see Parameters related to physical restore.