This topic describes the restore command group of obshell. The restore command group is used to cancel restore tasks and view details about restore tasks. Before you use the commands in this group, make sure that the OceanBase cluster has been initialized. For more information about a command, you can specify the -h/--help option in the command.
obshell tenant restore
You can use this command to restore a backup file to a specified tenant.
${home_path}/bin/obshell tenant restore <tenant_name> [flags]
# example
/home/admin/oceanbase/bin/obshell tenant restore mytenant --timestamp "2021-01-01T00:00:00.000+08:00" -z "zone1,zone2,zone3" -d '/path/to/backup/data' -a '/path/to/backup/clog' -u unit1
home_path is the installation directory of OceanBase Database, and obshell is located in the bin directory of OceanBase Database. tenant_name is the name of the tenant to restore.
The options are described as follows:
Option |
Required |
Type |
Default value |
Description |
|---|---|---|---|---|
| -d/--data_backup_uri | Yes | string | None | The data backup URI of the source tenant. |
| -z/--zone | No | string | None | The zone distribution of the tenant. If not specified, all zones in the cluster are used. |
| --unit_num | No | int | 1 | The number of units of the tenant in the target zone. The value must be less than the number of nodes in the target zone. |
| -u/--unit | No | string | None | The resource specifications of the resource pool used by the tenant.
NoteYou can specify the resource specifications for a particular zone in the format of |
| --replica_type | No | string | FULL | The replica type of the tenant in the target zone. Valid values: FULL (full-featured replica) and READONLY (read-only replica).
NoteYou can specify the replica type for a particular zone in the format of |
| --primary_zone | No | string | RANDOM | The primary zone of the tenant, which indicates the priority of zones providing read/write services to the tenant. For example, primary_zone ='zone1;zone2,zone3' means that the tenant is primarily served by zone1. zone1 has a higher priority than zone2 and zone3, which are at the same priority. |
| -T/--timestamp | No | string | None | The timestamp to restore to. The value must be in the format of "2006-01-02T15:04:05.000Z07:00". |
| -S/--scn | No | int | None | The SCN to restore to. |
| -a/--archive_log_uri | No | string | ${data_backup_uri} | The log archive URI of the source tenant. If not specified, the value of -d/--data_backup_uri is used. |
| -s/--ha_high_thread_score | No | int | None | The current working thread count of the high-priority thread for ensuring high availability. The value range is [0,100]. |
| -c/--concurrency | No | int | None | The concurrency level of data restoration. If not specified, the value equals the maximum number of CPU cores allocated to the tenant. |
| -D/--decryption | No | string | None | The password for restoring the backup. It is required only when a password is added during data backup. |
| -k/--kms_encrypt_info | No | string | None | The encryption information. It is required when the data is encrypted or when the original key management service cannot be accessed during restoration. |
obshell restore cancel
You can use this command to cancel a restore task for a tenant.
${home_path}/bin/obshell restore cancel <tenant_name> [-y]
# example
/home/admin/oceanbase/bin/obshell restore cancel tenant1
home_path is the installation directory of OceanBase Database. By default, obshell is located in the bin directory of OceanBase Database. tenant_name is the name of the tenant for which the restore task is to be canceled.
You can use the -y/--yes option to skip the secondary confirmation. This option does not require a value.
obshell restore show
You can use this command to show the restore tasks of a tenant.
${home_path}/bin/obshell restore show <tenant_name> [-d]
# example
/home/admin/oceanbase/bin/obshell restore show tenant1
home_path is the installation directory of OceanBase Database. By default, obshell is located in the bin directory of OceanBase Database. tenant_name is the name of the tenant whose restore tasks are to be shown.
You can use the -d/--show_detail option to specify whether to show the details of the restore tasks. This option does not require a value.
