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.
Follow the steps in Tenant restore, Database restore, or Table restore to configure and submit the restore task for the selected object type. 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 its procedure.
Tenant restore
On the Restore page, set Restore object to Tenants.
Select the restore source based on where the backup data is stored, and configure the source information and target cluster.
Note
- Restore source is available for tenant restores and defaults to Local. It is not displayed for database or table restores, which use local backups.
- The Remote option is displayed for instances on Alibaba Cloud, AWS, and Huawei Cloud.
- The Custom storage option is displayed only for instances with hybrid storage enabled.
Restore sourceRestore methodTarget clusterLocal Backup set or point in time Select an available target cluster or create a cluster. Remote Point in time The current instance; cannot be changed. Custom storage Backup set Select an available target cluster or create a cluster. LocalRemoteCustom storageSet Restore source to Local.
Select the Restore method and configure the corresponding source information.
Restore methodSource informationBackup set Select the backup set to restore in By backup set, and then select the Source tenant. Point in time Select the Source tenant and set Restore to. In Target information, select the Target cluster to which you want to restore the tenant data. You can also click Create Instance to create a cluster as the restore target.
Note
Grayed-out clusters cannot be selected as restore targets. Hover over a cluster name to view the reason.
Set Restore source to Remote. Only By Timestamp is available for Restore method.
In Source information, select the Source cluster. The list contains clusters with remote backup files in the current region.
Select the Source tenant and set Restore to.
In Target information, check the Target cluster. It is fixed to the current instance and cannot be changed.
After a hybrid backup succeeds, you can restore tenant data from the Alibaba Cloud OSS or AWS S3 bucket that stores the backup. For instructions on preparing hybrid backups and access keys, see Initiate a backup immediately.
Note
- Restoring from custom storage is available only to allowlisted users. To enable it, contact OceanBase Technical Support.
- Use the object storage service for your instance's cloud provider: OSS for Alibaba Cloud instances and S3 for AWS instances.
- Custom storage supports restoring from a backup set only. Point-in-time restore is not supported.
Set Restore source to Custom storage. Only Backup Set is available for Restore method.
In Source information, enter the AccessKey ID and AccessKey Secret used to access the backup bucket, and click Validate.
After validation succeeds, select the bucket containing the hybrid backup in Target bucket.
Note
This field specifies the storage location from which backup data is read.
Select the backup set to restore in By backup set, and then select the Source tenant.
In Target information, select the Target cluster to which you want to restore the tenant data. You can also click Create Instance to create a cluster as the restore target.
Note
The system checks conditions such as the target cluster's OceanBase Database version and cluster status. Select an available target cluster from the console. For a grayed-out cluster, hover over its name to view the reason.
Configure the target tenant name, resources, and other parameters.
Configure the following parameters in Target information. The available resource options depend on the configuration of the selected target cluster.
ParameterDescriptionTarget tenant name Enter a name for the new tenant. The name must be unique within the target instance, contain 2 to 64 characters, and use only Chinese characters, digits, English letters, Japanese characters, underscores, and hyphens. Unit count Specify the number of resource units for the target tenant. Unit spec Specify 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 If this field is displayed, select the primary zone of the target tenant. Remarks (optional) Enter remarks of up to 30 characters. Click Restore, and then click Restore again in the dialog box. You can view the task status on the Data Restore page of the target instance.
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.
Select the Restore method and configure the corresponding parameters in Source information.
Restore methodSource informationBackup Set Select the backup set to restore in By backup set, and then select the Source tenant. By Timestamp Supported only for physical restores. Select the Source tenant and set Restore to. In Select databases, select the databases to restore from Source databases and check your selection in Selected databases. You can search by database name or click Remove all to clear the selection.
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.
In Target information, select the Target instance to which you want to restore the data, and then select the Target tenant in that instance.
When restoring from a logical backup, skip to the next step; no auxiliary tenant is required. When restoring from an OceanBase Database 4.x physical backup, configure the following resource parameters in Auxiliary Tenant. Make sure that the target instance has enough remaining CPU and memory resources for the selected specifications.
ParameterDescriptionUnit count Specify the number of resource units for the auxiliary tenant. Unit spec Specify the CPU and memory specifications for the auxiliary tenant. Click View Resource Distribution to view the resource allocation on each node. Click Restore, and then click Restore again in the dialog box. You can view the task status on the Data Restore page of the target instance.
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.
Select the Restore method and configure the corresponding parameters in Source information.
Restore methodSource informationBackup Set Select the backup set to restore in By backup set, and then select the Source tenant. By Timestamp Supported only for physical restores. Select the Source tenant and set Restore to. In Select tables, select the tables to restore from Source tables and check your selection in Selected tables. You can search by table name or click Remove all to clear the selection.
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.
In Target information, select the Target instance to which you want to restore the data, and then select the Target tenant in that instance.
When restoring tables from a logical backup, also select the database that will receive the restored data in Target database.
When restoring from a logical backup, skip to the next step; no auxiliary tenant is required. When restoring from an OceanBase Database 4.x physical backup, configure the following resource parameters in Auxiliary Tenant. Make sure that the target instance has enough remaining CPU and memory resources for the selected specifications.
ParameterDescriptionUnit count Specify the number of resource units for the auxiliary tenant. Unit spec Specify the CPU and memory specifications for the auxiliary tenant. Click View Resource Distribution to view the resource allocation on each node. Click Restore, and then click Restore again in the dialog box. You can view the task status on the Data Restore page of the target instance.
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. Click Restore, and then click Restore again in the dialog box.
You can view the task status on the Data Restore page of the target instance. After the restore completes, you can view the restored tables in the new tenant.
View a restore task
You can view the initiated restore task 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.