This topic describes the parameters in table restore statements.
Statements
Restore tables:
ALTER SYSTEM RECOVER TABLE table_name_list TO TENANT dest_tenant_name FROM uri [UNTIL [TIME|SCN]=['timestamp'|scn]] WITH 'restore_option' [WITH KEY FROM 'backup_key_path' ENCRYPTED BY 'password'] [REMAP TABLE remap_table_name_list] [REMAP TABLEGROUP remap_tablegroup_list] [REMAP TABLESPACE remap_tablespace_list];Cancel a table restore job:
ALTER SYSTEM CANCEL RECOVER TABLE dest_tenant_name;
Parameters
| Parameter | Description |
|---|---|
| table_name_list | The list of tables to be restored, in the format of database_name.table_name1,database_name.table_name2,.... Separate the table names with commas (,). When this parameter is specified, letters in the database_name and table_name values are persisted to an internal table.
|
| dest_tenant_name | The name of the destination tenant to which the table is to be restored. You can restore a table only to a user tenant, but not to the sys tenant or a meta tenant. |
| uri | The data backup path and the log archive path, which are the same as those in the tenant physical restore command. If the data backup is initiated by using PLUS ARCHIVELOG, you need to specify only one path. Otherwise, the value must contain at least one data backup path and one log archive path, for example, 'file:///backup/archive, file:///backup/data'. |
| 'timestamp'|scn | The timestamp or SCN to which the table is restored. To restore to a specified timestamp or SCN, join the parameter name and value with an equal sign (=). By default, if you do not specify the UNTIL clause, the table is restored to the latest checkpoint. |
| restore_option | The restore options, including pool_list, locality, primary_zone, and concurrency. Separate the options with ampersands (&).
|
| WITH KEY FROM 'backup_key_path' ENCRYPTED BY 'password' | Specifies the backup information of the key for encrypting the tenant. You need to specify the related information for key backup during restore only when transparent encryption is configured for the source tenant. The parameters are described as follows:
|
| remap_table_name_list | The new name of the restored table. You can perform any of the following operations: rename the restored table without changing the database to which the table belongs, remap the restored table to another database without changing the table name, or rename the restored table and remap the table to another database. Use a colon (:) to join the source object and the renamed object. The syntax varies with the operation that you perform:
|
| remap_tablegroup_list | The table group to which the restored table belongs. By default, if the source table is bound to a table group, the system restores the table to a table group with the same name in the destination tenant. If the table group with the same name does not exist, the table fails to be restored. If the destination tenant has other table groups, you can execute this statement to restore the table to another table group. Join the source object and the remapped-to object with a colon (:). For example, to restore all tables in the source table group tg1 to the newtg1 table group in the destintion tenant, use the following syntax: REMAP TABLEGROUP tg1:newtg1. |
| remap_tablespace_list | The tablespace to which the restored table belongs. A tablespace is a logical unit in OceanBase Database mainly used for data encryption. By default, if the source table is bound to a tablespace, the system restores the table to the tablespace with the same name in the destination tenant. If the tablespace with the same name does not exist, the table fails to be restored. If the destination tenant has other tablespaces, you can execute this statement to restore the table to another tablespace. Join the source object and the remapped-to object with a colon (:). For example, to restore all tables in the source tablespace ts1 to the newts1 tablespace in the destination tenant, use the following syntax: REMAP TABLESPACE ts1:newts1. |