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 information
Physical restore is associated with the Physical Standby Database feature. A physically restored tenant serves as a standby tenant. You can convert it into the primary tenant 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 in 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 system change number (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
Log in to the database as an administrator of the standby tenant.
Note
The administrator user is
rootfor a MySQL tenant andSYSfor an Oracle tenant.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.