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 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 an ongoing tenant restore
ALTER SYSTEM CANCEL RESTORE dest_tenant_name;
Parameters
For the restore method with a specified timestamp, OceanBase AI Database converts the timestamp into the corresponding SCN based on the time zone most recently recorded in the backup set. The time zone comes from the system_time_zone system variable of the backup tenant, whose default value is 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 RESTORE.
Constraints on specifying the timestamp and SCN
The timestamp and scn must be greater than or equal to the minimum restore point MIN_RESTORE_SCN recorded in the data backup view CDB_OB_BACKUP_SET_FILES, and less than or equal to the maximum archive point CHECKPOINT_SCN in the log archive view CDB_OB_ARCHIVELOG. Log archiving may be interrupted. Therefore, when you specify the restore point, you must also consider discontinuous intervals in log archiving, and the restorable window may be segmented.
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, andfull_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, when you calculate the restorable interval, you must exclude the discontinuous periods. As a result, the restorable window is segmented, which is the range enclosed by the brackets in the figure: [scn 300, scn 500] \∪ [scn 900, scn 1500].
Parameters in the restore performance tuning statements
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 for log restore. |
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 an 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 | Continuously replays 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. |