This topic describes the parameters in table restore statements.
Syntax
Restore tables
ALTER SYSTEM RECOVER TABLE table_name_list TO [TENANT [=]] dest_tenant_name FROM uri [UNTIL {TIME='timestamp'} | {SCN=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] [DESCRIPTION [=] description];Cancel an ongoing table restore
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,.... The table names are separated with commas (,). When you specify database_name and table_name, take note of the following considerations:
|
| 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'. |
| {TIME='timestamp'} | {SCN=scn} | The inclusive timestamp or SCN up to which the table is restored. To restore to a specified TIME or SCN value, join the parameter name and value with an equal sign (=). By default, if you do not specify the UNTIL clause, the tenant is restored to the latest timestamp or SCN. |
| restore_option | The restore options, including pool_list, locality, primary_zone, and concurrency. Separate the options with ampersands (&). We recommend that you set locality and primary_zone to the same values as those of the source tenant.
|
| WITH KEY FROM 'backup_key_path' ENCRYPTED BY 'password' | The key backup information of the tenant. You need to specify the key backup information for a tenant restore only when the tenant is configured with transparent encryption. 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 table without changing the database to which the table belongs, restore the table to another database without changing the table name, or rename the table and restore 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:
NoteIf the new value of |
| 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. Use a colon (:) to join the source object and the renamed object. For example, to restore all tables in the source table group tg1 to the newtg1 table group in the destination 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. Use a colon (:) to join the source object and the renamed object. 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. |