OceanBase logo

OceanBase

A unified distributed database ready for your transactional, analytical, and AI workloads.

DEPLOY YOUR WAY

OceanBase Cloud

The best way to deploy and scale OceanBase

OceanBase Enterprise

Run and manage OceanBase on your infra

TRY OPEN SOURCE

OceanBase Community Edition

The free, open-source distributed database

OceanBase seekdb

Open source AI native search database

Customer Stories

Real-world success stories from enterprises across diverse industries.

View All
BY USE CASES

Mission-Critical Transactions

Global & Multicloud Application

Elastic Scaling for Peak Traffic

Real-time Analytics

Active Geo-redundancy

Database Consolidation

Resources

Comprehensive knowledge hub for OceanBase.

Blog

Live Demos

Training & Certification

Documentation

Official technical guides, tutorials, API references, and manuals for all OceanBase products.

View All
PRODUCTS

OceanBase Cloud

OceanBase Database

Tools

Connectors and Middleware

QUICK START

OceanBase Cloud

OceanBase Database

BEST PRACTICES

Practical guides for utilizing OceanBase more effectively and conveniently

Company

Learn more about OceanBase – our company, partnerships, and trust and security initiatives.

About OceanBase

Partner

Trust Center

Contact Us

International - English
中国站 - 简体中文
日本 - 日本語
Sign In
Start on Cloud

A unified distributed database ready for your transactional, analytical, and AI workloads.

DEPLOY YOUR WAY

OceanBase Cloud

The best way to deploy and scale OceanBase

OceanBase Enterprise

Run and manage OceanBase on your infra

TRY OPEN SOURCE

OceanBase Community Edition

The free, open-source distributed database

OceanBase seekdb

Open source AI native search database

Customer Stories

Real-world success stories from enterprises across diverse industries.

View All
BY USE CASES

Mission-Critical Transactions

Global & Multicloud Application

Elastic Scaling for Peak Traffic

Real-time Analytics

Active Geo-redundancy

Database Consolidation

Comprehensive knowledge hub for OceanBase.

Blog

Live Demos

Training & Certification

Documentation

Official technical guides, tutorials, API references, and manuals for all OceanBase products.

View All
PRODUCTS
OceanBase CloudOceanBase Database
ToolsConnectors and Middleware
QUICK START
OceanBase CloudOceanBase Database
BEST PRACTICES

Practical guides for utilizing OceanBase more effectively and conveniently

Learn more about OceanBase – our company, partnerships, and trust and security initiatives.

About OceanBase

Partner

Trust Center

Contact Us

Start on Cloud
编组
All Products
    • Databases
    • iconOceanBase Database
    • iconOceanBase Cloud
    • iconOceanBase Tugraph
    • iconInteractive Tutorials
    • iconOceanBase Best Practices
    • Tools
    • iconOceanBase Cloud Platform
    • iconOceanBase Migration Service
    • iconOceanBase Developer Center
    • iconOceanBase Migration Assessment
    • iconOceanBase Admin Tool
    • iconOceanBase Loader and Dumper
    • iconOceanBase Deployer
    • iconKubernetes operator for OceanBase
    • iconOceanBase Diagnostic Tool
    • iconOceanBase Binlog Service
    • Connectors and Middleware
    • iconOceanBase Database Proxy
    • iconEmbedded SQL in C for OceanBase
    • iconOceanBase Call Interface
    • iconOceanBase Connector/C
    • iconOceanBase Connector/J
    • iconOceanBase Connector/ODBC
    • iconOceanBase Connector/NET
icon

OceanBase Database

SQL - V4.2.0

    Download PDF

    OceanBase logo

    The Unified Distributed Database for the AI Era.

    Follow Us
    Products
    OceanBase CloudOceanBase EnterpriseOceanBase Community EditionOceanBase seekdb
    Resources
    DocsBlogLive DemosTraining & Certification
    Company
    About OceanBaseTrust CenterLegalPartnerContact Us
    Follow Us

    © OceanBase 2026. All rights reserved

    Cloud Service AgreementPrivacy PolicySecurity
    Contact Us
    Document Feedback
    1. Documentation Center
    2. OceanBase Database
    3. SQL
    4. V4.2.0
    iconOceanBase Database
    SQL - V 4.2.0
    SQL
    KV
    • V 4.4.2
    • V 4.3.5
    • V 4.3.3
    • V 4.3.1
    • V 4.3.0
    • V 4.2.5
    • V 4.2.2
    • V 4.2.1
    • V 4.2.0
    • V 4.1.0
    • V 4.0.0
    • V 3.1.4 and earlier

    Physical restore parameters

    Last Updated:2025-12-03 11:18:03  Updated
    share
    What is on this page
    Restore commands
    Commands
    Parameter explanation
    Constraints on timestamp and scn
    Performance-related
    Command
    Parameter explanation
    Commands
    Start the restore process
    Parameters
    Active command
    Command
    Parameter explanation

    folded

    share

    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.
    • pool_list: the resource pools created for the destination tenant. Multiple resource pools are separated with commas (,). This parameter is mandatory.
    • locality: the locality information of replica sets of the destination tenant. It needs to match the zone information of the pool_list parameter of the destination cluster.
      We recommend that you specify the locality parameter to be consistent with that of the source tenant. Specifically, we recommend that you specify the same number of full-featured (F) zones in the locality parameter as those in the source tenant. If you do not specify the locality parameter, the system will set up an F replica in each zone based on the zone_list in the resource_pool parameter.
      The format of the locality parameter is as follows: locality='F@z1,F@z2,F@z3'.
    • primary_zone: the preferred zone of the leader replica of the destination tenant. It needs to match the zone information of the pool_list and locality parameters, namely, the zone information needs to be consistent, and there must be at least two Paxos members in the primary_region.
      We recommend that you specify the primary_zone parameter to be consistent with that of the source tenant. Specifically, we recommend that you specify the same number of primary zones in the primary_zone parameter as those in the source tenant. If you do not specify the primary_zone parameter, the system will randomly distribute the leader across the zones specified in the locality parameter.
      The format of the primary_zone parameter is as follows: primary_zone='z1'.
    • concurrency: the degree of concurrency for restore. If you do not specify this parameter, the default value, which is equal to the maximum number of CPU cores allocated to the tenant, is used.
      The format is as follows: concurrency=50.
    • kms_encrypt: specifies whether to use the key used for encryption during restore. If set to true, you must specify the kms_encrypt_info parameter before restore. The default value is false.
    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,
    • backup_key_path indicates the backup path of the secret key.
    • password indicates the encryption password set when the secret key is backed up.
    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_id of 1 and 2, respectively.

    • Three data backups are initiated, and the effective ones are full_backup_set_1, full_backup_set_2, and inc_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.

    Restoreable periods

    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.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.

      ALTER SYSTEM RECOVER STANDBY [TENANT tenant_name] UNTIL TIME='timestamp';
      
    • Restore logs to the specified SCN, which must be in the =-connected SCN format and include the scn parameter.

      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.

    Previous topic

    Replay logs to a standby tenant
    Last

    Next topic

    Views related to physical restore
    Next
    What is on this page
    Restore commands
    Commands
    Parameter explanation
    Constraints on timestamp and scn
    Performance-related
    Command
    Parameter explanation
    Commands
    Start the restore process
    Parameters
    Active command
    Command
    Parameter explanation