This topic describes the parameters related to physical restore in the restore command.
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;
Parameter explanation
| 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 is completed when the specified timestamp is reached, and the data and logs up to the timestamp are included. The timestamp parameter must be followed by =. The timestamp parameter supports only the YYYY-MM-DD HH24:MI:SS.FF format. Five to six digits (FF) are supported after the decimal point, allowing precision to the microsecond. |
| scn | The SCN to restore to. The restore is completed when the specified scn is reached, and the data and logs up to the scn are included. The scn parameter must be followed by =. |
| 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 configure the destination tenant to be homogeneous with the source tenant when you specify locality and primary_zone. If the destination tenant is heterogeneous with the source tenant, 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 tenant cannot be restored. Among them:
|
| description | The description information specified by the user. It is an optional parameter. |
Constraints on timestamp and scn
The values of timestamp and scn 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 SCN range is also discontinuous.
For example, assume that the backup situation of a user is as follows:
Two log archives are initiated with their
round_idvalues being 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 record 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 record is the CHECKPOINT_SCN (scn 500 for the log archive round 1 in the figure).

The log archive stream may be interrupted. Therefore, discontinuous time periods must be excluded when calculating the restore SCNs, resulting in discontinuous recoverable ranges, namely, the ranges enclosed by the {} in the figure: [scn 300, scn 500] \∪ [scn 900, scn 1500].
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 to a specified timestamp or SCN
Restore logs to the specified timestamp, including the
timestamppoint.ALTER SYSTEM RECOVER STANDBY [TENANT [=] tenant_name] UNTIL TIME='timestamp';Restore logs to the specified SCN, including the
scnpoint.ALTER SYSTEM RECOVER STANDBY [TENANT [=] tenant_name] UNTIL SCN=scn;Start an unlimited restore, which continuously restores logs from the archive source.
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 | Restore logs to the specified timestamp, including the timestamp point. The timestamp parameter must be in the format of YYYY-MM-DD HH24:MI:SS.FF, and the FF part (which indicates microseconds) can have 0 to 6 digits. Only logs up to the timestamp point are restored. |
| scn | Restore logs to the specified scn, including the scn point. The scn parameter must be in the format of =. Only logs up to the scn point are restored. |
| UNLIMITED | Continuously restore logs from the archive source. |
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 per command. |