This topic describes the parameters in a 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 backup. The value of this parameter contains at least a data backup path and a log archive path, separated by ,. |
| timestamp | The timestamp to restore to. The restore is performed up to the specified timestamp, and the data of the timestamp point is included. The timestamp parameter must be specified with =. The timestamp parameter supports only the YYYY-MM-DD HH24:MI:SS.FF format. Five to six digits ( FF) after the decimal point are supported, allowing a precision of up to microseconds. |
| scn | The SCN to restore to. The restore is performed up to the specified SCN, and the data of the scn point is included. The scn parameter must be specified with =. |
| restore_option | Allows you to specify pool_list, locality, primary_zone, concurrency, and kms_encrypt. These parameters are separated with &. We recommend that you specify the locality and primary_zone parameters to be consistent with those of 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 the tenant to be restored. This parameter is required only when transparent encryption is configured for the source tenant. Here,
|
| description | The description of the tenant. This parameter is optional. |
Constraints on timestamp and scn
The timestamp and scn parameters must be greater than or equal to the minimum restore SCN MIN_RESTORE_SCN of data backups in the CDB_OB_BACKUP_SET_FILES view and less than or equal to the maximum archive SCN CHECKPOINT_SCN in the CDB_OB_ARCHIVELOG view. However, the log archive stream may be interrupted, so the restore SCN must avoid the interrupted periods, resulting in a discontinuous restoreable period. The restoreable periods can be segmented.
For example, assume that the backup situation of a user is as follows:
Two log archives are initiated with
round_idof 1 and 2, respectively.Three data backups are initiated, and the effective ones are
full_backup_set_1,full_backup_set_2, andinc_backup_set_3.
The following figure shows the restoreable periods for physical restore. The right borders of the data backup periods are all at the MIN_RESTORE_SCN, such as scn 300 for the data backup full_backup_set_1; the right borders of the log archive periods are all at the CHECKPOINT_SCN, such as scn 500 for the log archive round 1.

The log archive stream may be interrupted, so the interrupted periods must be excluded when calculating the restore periods, resulting in discontinuous restore periods, namely, {[scn 300, scn 500] \∪ [scn 900, scn 1500]} in the preceding 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 the restore process
Restore logs to the specified timestamp, which must be in the
YYYY-MM-DD HH24:MI:SS.FFformat and 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 and include thescnparameter.ALTER SYSTEM RECOVER STANDBY [TENANT tenant_name] UNTIL SCN=scn;Restore logs without an end point, namely, continuously restore archive source logs.
ALTER SYSTEM RECOVER STANDBY [TENANT tenant_name] UNTIL UNLIMITED;Cancel the restore process.
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 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 and include the scn parameter. |
| UNLIMITED | The restore is performed continuously by restoring archive source logs. |
Active command
Command
ALTER SYSTEM ACTIVATE STANDBY TENANT tenant_name;
Parameter explanation
| Parameter | Description |
|---|---|
| tenant_name | The name of the restored tenant. Currently, each command supports the switchover of only one tenant. |