This topic describes the parameters in restore statements.
Parameters in the RESTORE statements
Syntax
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 system change number (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 timestamp
ALTER SYSTEM RESTORE dest_tenant_name FROM uri WITH 'restore_option' [WITH KEY FROM 'backup_key_path' ENCRYPTED BY 'password'] [DESCRIPTION [=] description];Cancel the restore of a tenant
ALTER SYSTEM CANCEL RESTORE dest_tenant_name;
Parameters
For the restore method with a specified timestamp, OceanBase Database converts the timestamp into the corresponding SCN based on the time zone most recently recorded in the backup set. The time zone here comes from the system_time_zone system variable of the backup tenant, with a default value of CST (China Standard Time, UTC+8:00), and is saved in the locality_info.obbak file of the backup set.
For example, assume that the time zone of the tenant is CDT (Central Daylight Time, UTC-5:00) during backup. If you specify the timestamp 2025-08-01 10:00:00 during restore, the actual restore time point is the SCN value corresponding to 2025-08-01 15:00:00 (standard UTC time).
For more information about the parameters, see ALTER SYSTEM - RESTORE.
Constraint for specifying the timestamp and SCN
The timestamp and SCN must be greater than or equal to the minimum restore SCN indicated by MIN_RESTORE_SCN in the data backup view CDB_OB_BACKUP_SET_FILES, and smaller than or equal to the maximum archive SCN indicated by CHECKPOINT_SCN in the log archive view CDB_OB_ARCHIVELOG. Log archiving may be interrupted. Therefore, you must consider inconsecutive ranges of logs when you specify the restore SCN. The restorable window may be discontinuous.
Assume that:
Two log archive rounds were initiated, with the
round_idvalues of1and2.Three data backup jobs were initiated, which produced three valid data backup sets:
full_backup_set_1,full_backup_set_2, andinc_backup_set_3.
The following figure shows the restorable window for physical restore. The right boundary of a data backup set is specified by MIN_RESTORE_SCN. For example, MIN_RESTORE_SCN of full_backup_set_1 corresponds to scn 300 in the figure. The right boundary of a log archive is specified by CHECKPOINT_SCN. For example, CHECKPOINT_SCN of round 1 corresponds to scn 500 in the figure.
Log archiving may be interrupted. Therefore, you must consider the inconsecutive time ranges when you calculate the restorable window. As a result, the restorable window is discontinuous. In the figure, the restorable window is [scn 300, scn 500] \∪ [scn 900, scn 1500].
Parameters in the restore performance tuning statement
Syntax
ALTER SYSTEM SET ha_high_thread_score =10 TENANT = mysql;
ALTER SYSTEM SET log_restore_concurrency =0 TENANT = mysql;
Parameters
Parameter |
Description |
|---|---|
| ha_high_thread_score | The number of worker threads for the restore job queue. |
| log_restore_concurrency | Sets the concurrency level for log restoration. |
Parameters in the RECOVER statements
Syntax
Replay logs to the specified timestamp, including the point at the specified timestamp.
ALTER SYSTEM RECOVER STANDBY [TENANT [=] tenant_name] UNTIL TIME='timestamp';Replay logs to the specified SCN, including the point at the specified SCN.
ALTER SYSTEM RECOVER STANDBY [TENANT [=] tenant_name] UNTIL SCN=scn;Continuously replay logs from the archive source without specifying the end point
ALTER SYSTEM RECOVER STANDBY [TENANT [=] tenant_name] UNTIL UNLIMITED;Cancel a log replay
ALTER SYSTEM RECOVER STANDBY TENANT [=] tenant_name CANCEL;
Parameters
Parameter |
Description |
|---|---|
| tenant_name | The name of the tenant. |
| timestamp | The timestamp to which data is restored. Data is restored up to and including the point at the specified timestamp. Join the parameter name and value with an equal sign (=). The value of timestamp must be in the YYYY-MM-DD HH24:MI:SS.FF format. The fractional part (FF) supports 0 to 6 decimal places, accurate to microseconds. |
| scn | The SCN to which data is restored. Data is restored up to and including the point at the specified scn. Join the parameter name and value with an equal sign (=). |
| UNLIMITED | Specifies to continuously replay logs from the archive source without specifying the end point. |
Parameters in the ACTIVATE STANDBY statement
Syntax
ALTER SYSTEM ACTIVATE STANDBY TENANT tenant_name;
Parameters
Parameter |
Description |
|---|---|
| tenant_name | The name of the standby tenant that is restored. You can use this statement to change the role of only one tenant at a time. |
