This topic describes how to restore data at the tenant, database, or table level.
Considerations
Version and compatibility requirements
The following table lists the version requirements for each restore scenario.
Restore scenarioVersion and compatibility requirementsRestore from a logical backup - When you select a target instance in the console, its database version must be the same as or later than the source instance's current version.
- Restoring from an OceanBase Database 2.x/3.x instance to a 4.x instance, or from a 4.0 instance to a 4.1 instance, is not supported.
Restore from a physical backup - The target database version must be the same as or later than the source version used to create the backup.
- Backups from OceanBase Database 2.x/3.x cannot be restored to 4.x instances. Backups from 4.0 cannot be restored to 4.1 instances.
- To restore databases or tables from an OceanBase Database 4.x physical backup, both the source and target instances must run OceanBase Database 4.2.1.0 or later.
- To restore tables from an OceanBase Database 2.x/3.x physical backup, all of the following conditions must also be met:
- Both the source and target instances must run 2.2.77 (including the equivalent version 2.2.77.0) or a 3.x version later than 3.2.3.3.
- Both instances must be deployed on Alibaba Cloud in the same region and belong to the same OceanBase Cloud account.
- The source and target instance types must match: a transactional instance can be restored to a transactional instance, and a Flagship Edition instance can be restored to a Flagship Edition instance.
Version requirements for All databases / All tables searches
To search for deleted databases or tables on the All databases or All tables tab, the OceanBase Database version used to create the physical backup must fall within one of these ranges:
[4.2.1.4, 4.2.2.0)[4.2.4.0, 4.3.0.0)
Physical backups created with some early patch versions do not support All databases / All tables searches. After you select a backup set or restore point in time and a source tenant, the system checks search support based on the database version and patch used to create the corresponding backup, as well as the restore source conditions. The All databases or All tables tab appears when searches are supported.
Upgrading the current instance does not change the version or patch information of existing backups. To check whether an existing backup supports searches, contact OceanBase Technical Support.
Target tenant and naming requirements
- When restoring to an existing tenant, the source and target tenants must use the same compatibility mode: both MySQL mode or both Oracle mode.
- When restoring a database to an existing tenant, the target tenant must not contain a database with the same name, even if it is empty.
- When restoring a table to an existing tenant, the target database must not contain a table with the same name.
- When restoring to a new tenant, the new tenant name must be unique within the target instance.
Restore object limitations
- Database-level and table-level restores do not support column-store tables.
- Physical table restores from OceanBase Database 2.x/3.x do not support restoring an entire database or renaming databases or tables.
- A successful restore of table data does not mean that indexes, constraints, or other associated schema objects have also been restored successfully.
Tenant creation and resource requirements
- Tenant-level restores and 2.x/3.x physical table restores: A new tenant is required. The new tenant and restored data are retained after the restore completes.
- 4.x physical database and table restores: Data is restored to an existing tenant. A temporary auxiliary tenant is created during the restore and is deleted by default when the restore completes.
- Logical restores: Data is restored to an existing tenant. No auxiliary tenant is required.
- To create a new tenant or an auxiliary tenant, the target instance must have enough remaining CPU and memory resources for the selected tenant specifications, as well as sufficient disk space.
Other requirements
Do not initiate multiple restore tasks simultaneously.
Initiate a restore task
Log in to the OceanBase Cloud console.
In the left-side navigation pane, click Instances and select the instance to restore.
On the instance overview page, click Backup in the left-side navigation pane.
In the upper-right corner, click Restore to open the Restore page.
Configure the parameters for the selected restore object as described below. Then follow steps 6 and 7 to submit the restore task.
Note
- To restore a tenant, see Tenant restore for the procedure and parameter descriptions.
- To restore databases or tables from a logical backup or an OceanBase Database 4.x physical backup, see Database restore or Table restore, respectively.
- To restore tables from an OceanBase Database 2.x/3.x physical backup, select the "Restore to a new tenant" tab in Table restore and follow the configuration steps.
Click Restore.
In the dialog box, click Restore. You can view the task status on the Data Restore page of the target instance.
Tenant restore
On the Restore page, set Restore object to Tenants.
Configure the restore parameters as described in the following table.
ParameterDescriptionRestore source Supports Local or Remote. Available sources and field visibility depend on the instance: - Shared Nothing Flagship Edition instances running OceanBase Database 2.x/3.x: The restore source field is displayed and defaults to Local. For instances deployed on Alibaba Cloud, AWS, or Huawei Cloud, Remote is also available.
- Shared Nothing Flagship Edition instances running OceanBase Database 4.x: The restore source field is hidden. Local backups are used directly.
- Shared Storage Flagship Edition instances running OceanBase Database 4.x: The restore source field is displayed, and only Local is supported.
Restore method Choose whether to restore from a backup set or to a point in time. - For a backup set, select By backup set and Source tenant in the source information.
- For a point in time, select Source tenant and set Restore to in the source information.
By backup set Select the backup set to restore. Source tenant Select the tenant whose data you want to restore. Restore to Select the restore point in time. Target cluster Select the cluster to which you want to restore data. You can also click Create Instance to create a cluster for the restored tenant data. Note
Grayed-out clusters cannot be selected as restore targets. Hover over a cluster name to view the reason.
Target tenant name Enter a name for the new target tenant. The name must meet these requirements: - It must be unique within the target instance.
- It must be 2 to 64 characters long.
- It can contain only Chinese characters, digits, English letters, Japanese characters, underscores, and hyphens.
Unit count Select the number of resource units for the target tenant. Unit spec Select the CPU and memory specifications for the target tenant. Make sure that the target instance has enough remaining CPU and memory resources for the selected specifications. Click View Resource Distribution to view the resource allocation on each node. Note
- The total CPU and memory resources allocated to all tenants must not exceed the instance specifications.
- Total available resources of a tenant = Resources allocated per replica × Number of nodes across which resources are distributed × Number of replicas.
Primary zone Select the primary zone of the target tenant. Remarks (optional) Enter remarks of up to 30 characters. After configuring the parameters, follow steps 6 and 7 in Initiate a restore task to submit the restore task.
Database restore
Note
- Logical restores: Databases can be restored only from a backup set. No auxiliary tenant is required.
- OceanBase Database 4.x physical restores: Databases can be restored from a backup set or to a point in time. An auxiliary tenant is created in the target instance during the restore. Note the following:
- The target instance must have sufficient disk space.
- If the auxiliary tenant has lower resource specifications than the source tenant, the restore may be slow.
- The system deletes the auxiliary tenant by default after the restore completes.
On the Restore page, set Restore object to Databases.
Configure the restore parameters as described in the following table.
ParameterDescriptionRestore method For logical backups, select Backup Set. For physical backups, select Backup Set or By Timestamp. - For Backup Set, select By backup set and Source tenant in the source information.
- For By Timestamp, select Source tenant and set Restore to in the source information.
By backup set Select the backup set to restore. Source tenant Select the tenant whose data you want to restore. Restore to Required only for physical restores. Select the restore point in time. Select databases Select the databases to restore. You can also search by database name. Note
- When restoring databases from an OceanBase Database 4.x physical backup, you can click the edit icon next to the database name in the target list to change the target name. The target tenant must not contain a database with the target name, even if it is empty.
- Search requirements: To search for databases or tables in a physical backup, the source tenant must be running, and the selected backup must be complete, valid, and not archived. To search for deleted objects, the physical backup must also be stored in object storage, and the database version used to create it must meet the requirements in "Version requirements for All databases / All tables searches" in this topic. The source instance's current version alone does not determine search support. The All databases tab appears when searches are supported.
- Search scope: On this tab, you can search for existing databases and deleted databases that have backups. The Existing databases tab lists only databases that currently exist in the source tenant.
- On the All databases tab, enter a database name and press Enter to search. Add the databases to restore to the target list and check your selection.
- Search results let you select objects to restore. Whether an object can be restored still depends on the selected backup set or restore point in time. If a search fails, click Retry. If no results match, check the object name and restore source.
Target instance Select the cluster instance to which you want to restore data. Target tenant Select the tenant to which you want to restore data. Unit count Required only for physical restores. Specify the number of resource units for the auxiliary tenant. Unit spec Required only for physical restores. Specify the CPU and memory specifications for the auxiliary tenant. Make sure that the target instance has enough remaining CPU and memory resources for the selected specifications. Click View Resource Distribution to view the resource allocation on each node. After configuring the parameters, follow steps 6 and 7 in Initiate a restore task to submit the restore task.
Table restore
Table restore has two workflows, depending on the backup type and OceanBase Database version:
- Restore to an existing tenant: Applies to logical backups and OceanBase Database 4.x physical backups. The selected tables are restored to an existing tenant.
- Restore to a new tenant: Applies to OceanBase Database 2.x/3.x physical backups that meet the version requirements. A new tenant is created in an existing target instance to receive the selected tables. The new tenant and restored data are retained after the restore completes.
For the requirements, see Considerations. Select the tab for your restore scenario to view the configuration instructions and procedure.
Note
- Logical restores: Tables can be restored only from a backup set. No auxiliary tenant is required.
- OceanBase Database 4.x physical restores: Tables can be restored from a backup set or to a point in time. An auxiliary tenant is created in the target instance during the restore. Note the following:
- The target instance must have sufficient disk space.
- If the auxiliary tenant has lower resource specifications than the source tenant, the restore may be slow.
- The system deletes the auxiliary tenant by default after the restore completes.
On the Restore page, set Restore object to Tables.
Configure the restore parameters as described in the following table.
ParameterDescriptionRestore method For logical backups, select Backup Set. For physical backups, select Backup Set or By Timestamp. - For Backup Set, select By backup set and Source tenant in the source information.
- For By Timestamp, select Source tenant and set Restore to in the source information.
By backup set Select the backup set to restore. Source tenant Select the tenant whose data you want to restore. Restore to Required only for physical restores. Select the restore point in time. Select tables Select the tables to restore. You can also search by table name. Note
- When restoring tables from an OceanBase Database 4.x physical backup, you can click the edit icon next to the database or table name in the target list to change the target name. The target database must not contain a table with the target name.
- Search requirements: To search for databases or tables in a physical backup, the source tenant must be running, and the selected backup must be complete, valid, and not archived. To search for deleted objects, the physical backup must also be stored in object storage, and the database version used to create it must meet the requirements in "Version requirements for All databases / All tables searches" in this topic. The source instance's current version alone does not determine search support. The All tables tab appears when searches are supported.
- Search scope: On this tab, you can search for existing tables and deleted tables that have backups. The Existing tables tab lists only tables that currently exist in the source tenant.
- On the All tables tab, choose a search method:
- To search for tables in a specific database, enter the database name and press Enter, or select the option labeled Database from the drop-down list.
- To search for tables with the same name across databases, enter the table name and select the option labeled Table from the drop-down list.
- To search for a specific table in a specific database, enter
database_name.table_nameand press Enter.
- Search results let you select objects to restore. Whether an object can be restored still depends on the selected backup set or restore point in time. If a search fails, click Retry. If no results match, check the object name and restore source.
Target instance Select the cluster instance to which you want to restore data. Target tenant Select the tenant to which you want to restore data. Target database Required only when restoring tables from a logical backup. Select the database to receive the restored tables. Unit count Required only for physical restores. Specify the number of resource units for the auxiliary tenant. Unit spec Required only for physical restores. Specify the CPU and memory specifications for the auxiliary tenant. Make sure that the target instance has enough remaining CPU and memory resources for the selected specifications. Click View Resource Distribution to view the resource allocation on each node. After configuring the parameters, follow steps 6 and 7 in Initiate a restore task to submit the restore task.
Note
- Requirements: The source and target instances must meet the cloud provider, account, region, instance type, and database version requirements in Considerations.
- Version checks: RPM build numbers are not included when checking the 2.x/3.x version ranges. For example, adding an RPM build number to 3.2.3.3 does not satisfy the requirement for a version later than 3.2.3.3.
- Target tenant: This workflow creates a new tenant to receive and retain the restored data. It does not use an auxiliary tenant that is deleted by default after the restore completes.
On the Restore page, set Restore object to Tables.
Select the Restore method and configure the source information.
Restore methodSource informationBackup Set Select the physical backup set to restore and the source tenant. By Timestamp Select the source tenant and specify the restore point in time. In Select tables, select the tables to restore and check the target tables. The target database and table names are read-only and cannot be changed.
In Target information, select an existing Target cluster and configure the new tenant.
ParameterDescriptionTarget tenant name Enter a name for the new tenant. The name must be unique within the target instance. Do not select an existing tenant here. Unit count Specify the number of resource units for the new tenant. Unit spec Specify the CPU and memory specifications for the new tenant. Make sure that the target instance has enough remaining resources for the selected specifications. If the new tenant has lower resource specifications than the source tenant, the restore may be slow. Primary zone If this field is displayed, select the primary zone of the new tenant. Remarks (optional) Enter remarks as needed. After configuring the parameters, follow steps 6 and 7 in Initiate a restore task to submit the restore task.
View a restore task
You can view the restore task you manually created on the Data Restore tab.
After the task completes, connect to the target tenant and check the restored databases, tables, and data. For tenant-level restores and 2.x/3.x physical table restores, connect to the newly created tenant. When restoring databases or tables to an existing tenant, check the configured target database and table names.