This topic describes the parameters used in restore commands.
Restore commands
Commands
Restore to a specified timestamp
ALTER SYSTEM RESTORE dest_tenant_name FROM uri UNTIL TIME='timestamp' WITH 'restore_option' [WITH KEY FROM 'backup_key_path' ENCRYPTED BY 'password'] [DESCRIPTION [=] description];Restore to a specified SCN
ALTER SYSTEM RESTORE dest_tenant_name FROM uri UNTIL SCN=scn WITH 'restore_option' [WITH KEY FROM 'backup_key_path' ENCRYPTED BY 'password'] [DESCRIPTION [=] description];Restore to the latest checkpoint
ALTER SYSTEM RESTORE dest_tenant_name FROM uri WITH 'restore_option' [WITH KEY FROM 'backup_key_path' ENCRYPTED BY 'password'] [DESCRIPTION [=] description];Cancel an ongoing tenant restore
ALTER SYSTEM CANCEL RESTORE dest_tenant_name;
Parameters
| Parameter | Description |
|---|---|
| dest_tenant_name | The name of the destination tenant to restore to. |
| uri | The data backup path backup_data_dest and log archive path log_archive_dest specified during the backup. This parameter value contains at least one data backup path and one log archive path, separated by ,. |
| timestamp | The timestamp to restore to. The restore will be completed by the specified timestamp, and the data at the timestamp point will be included. The timestamp parameter must be specified with =. The timestamp parameter supports only the YYYY-MM-DD HH24:MI:SS.FF format. The decimal part (FF) supports 0 to 6 digits, indicating the microsecond precision. |
| scn | The SCN to restore to. The restore will be completed by the specified SCN, and the data at the scn point will be included. The scn parameter must be specified with =. |
| restore_option | Allows you to specify parameters such as pool_list, locality, primary_zone, concurrency, and kms_encrypt. Parameters are separated with &. We recommend that you specify the locality and primary_zone parameters to be consistent with those in the source tenant. If they are inconsistent, activating the destination tenant as the primary tenant after the restore may cause load balancing operations, which affects the performance.
|
| WITH KEY FROM 'backup_key_path' ENCRYPTED BY 'password' | The secret key backup information of an encrypted tenant. If transparent encryption is configured for the source tenant, you must specify this parameter during the restore. Otherwise, the data of the tenant cannot be decrypted. Here,
|
| description | Optional. It is the description information specified by the user. |
Constraints on timestamp and scn
The timestamp and scn values must be greater than or equal to the minimum restore SCN MIN_RESTORE_SCN of data backup records in the CDB_OB_BACKUP_SET_FILES view and less than or equal to the maximum checkpoint SCN CHECKPOINT_SCN in the CDB_OB_ARCHIVELOG view. However, the log archive stream may be interrupted, so restore SCNs are discontinuous. In this case, the recoverable range may be segmented. For example, the recoverable range can be [scn 300, scn 500] \∪ [scn 900, scn 1500].
As an example, assume that the backup situation of a user is as follows:
Two log archives are initiated with
round_idvalues of 1 and 2, respectively.Three data backups are initiated, namely,
full_backup_set_1,full_backup_set_2, andinc_backup_set_3.
The following figure shows the recoverable ranges for physical restore. The right boundary of each data backup is the MIN_RESTORE_SCN (scn 300 for the data backup full_backup_set_1 in the figure); the right boundary of each log archive is the CHECKPOINT_SCN (scn 500 for the log archive round 1 in the figure).

Performance-related
Command
ALTER SYSTEM SET ha_high_thread_score =10 TENANT = mysql;
Parameter explanation
| Parameter | Description |
|---|---|
| ha_high_thread_score | The number of threads used by the restore task queue. |
Commands
Start a restore
Restore logs to the specified timestamp, which must be in the
YYYY-MM-DD HH24:MI:SS.FFformat and must include thetimestampparameter. Thetimestampparameter must be connected with an=sign. The decimal part (FF) of thetimestampparameter supports 0 to 6 digits to indicate microseconds.ALTER SYSTEM RECOVER STANDBY [TENANT [=] tenant_name] UNTIL TIME='timestamp';Restore logs to the specified SCN, which must be in the
=-connectedscnformat. Thescnparameter must be an integer.ALTER SYSTEM RECOVER STANDBY [TENANT [=] tenant_name] UNTIL SCN=scn;Restore logs without an end point, that is, continuously restore archive source logs.
ALTER SYSTEM RECOVER STANDBY [TENANT [=] tenant_name] UNTIL UNLIMITED;Cancel a restore.
ALTER SYSTEM RECOVER STANDBY TENANT [=] tenant_name CANCEL;
Parameters
| Parameter | Description |
|---|---|
| tenant_name | Tenant name |
| timestamp | The restore is performed to the specified timestamp, which must be in the YYYY-MM-DD HH24:MI:SS.FF format and must include the timestamp parameter. The timestamp parameter must be connected with an = sign. The decimal part (FF) of the timestamp parameter supports 0 to 6 digits to indicate microseconds. |
| scn | The restore is performed to the specified scn, which must be in the =-connected scn format. The scn parameter must be an integer. |
| UNLIMITED | The restore is performed continuously without an end point, that is, continuously restore archive source logs. |
ACTIVATE STANDBY command
Command
ALTER SYSTEM ACTIVATE STANDBY TENANT tenant_name;
Parameter explanation
| Parameter | Description |
|---|---|
| tenant_name | The name of the restored standby tenant. Currently, only one tenant can be switched at a time. |