This topic describes the obshell backup command group. The backup command group allows you to set up backup configurations and view backup tasks. The OceanBase cluster must be initialized before you use this command group. You can configure the -h/--help option in the command to view the help information.
obshell backup set-config
You can use this command to set backup-related configurations for all tenants or a specified tenant.
${home_path}/bin/obshell backup set-config [flags]
# example
/home/admin/oceanbase/bin/obshell backup set-config -t tenant1 -d /path/to/backup/data -a /path/to/backup/archive
home_path is the installation directory of OceanBase Database. By default, obshell is located in the bin directory of OceanBase Database.
The following table describes the options:
Option |
Required |
Type |
Default value |
Description |
|---|---|---|---|---|
| -t/--tenant_name | No | string | None | The name of the tenant for which to set the backup configurations. If you do not specify this option, the configurations will be set for all tenants in the cluster. |
| -d/--data_backup_uri | No | string | None | The destination for backing up the data of the tenant. If you have specified a destination before, the default value of this option retains the previous setting. If you have not specified a destination before, the default value of this option is an empty string.
NoteThis option takes effect only when you specify |
| -a/--archive_log_uri | No | string | None | The destination for archiving the logs of the tenant. If you have specified a destination before, the default value of this option retains the previous setting. If you have not specified a destination before, the default value of this option is an empty string.<main id.notice" type='explain'>NoteThis option takes effect only when you specify |
| -u/--backup_base_uri | No | string | None | The destination for backing up all tenants. After this option is configured, the data backup path and log archive path of each tenant will be generated by using a specified rule under the specified path.
NoteThis option takes effect only when you do not specify |
| -c/--log_archive_concurrency | No | int | None | The total number of worker threads for archiving logs. |
| -b/--binding | No | string | Optional | The value of this option can be Optional (user business priority) or Mandatory (archiving priority). If you do not specify this option, the default value Optional takes effect. |
| -i/--piece_switch_interval | No | string | None | The cycle for switching pieces. The value range is [1d, 7d]. |
| -l/--archive_lag_target | No | string | None | The latency for archiving logs of the tenant. Before you modify this parameter, make sure that the destination for archiving logs has been configured. |
| -D/--delete_policy | No | string | default | The cleanup strategy. A tenant with a specified cleanup strategy will trigger an automatic cleanup every hour. Currently, the value can only be set to default, which specifies to automatically clear only the backups in -d/--data_backup_uri and -a/--archive_log_uri. |
| -r/--delete_recovery_window | No | string | None | The time window for restoring backup data, with a unit that you need to specify. For more information, see Overview of backup-related parameters. |
| -s/--ha_low_thread_score | No | int | None | The number of worker threads for medium- and low-priority tasks such as backup and backup cleanup. The value range is [0, 100]. |
obshell cluster backup
You can use this command to set backup-related configurations for all tenants in a cluster and initiate a backup.
${home_path}/bin/obshell cluster backup [flags]
# example
/home/admin/oceanbase/bin/obshell obshell cluster backup -u /path/to/backup --backup_mode incremental --encryption MySecretPassword
home_path is the installation directory of OceanBase Database. By default, obshell is located in the bin directory of OceanBase Database.
The following table describes the options:
Option |
Required |
Type |
Default value |
Description |
|---|---|---|---|---|
| -u/--backup_base_uri | No | string | None | Set the backup destination for all tenants. After setting, the data backup path and log archive path for each tenant will be concatenated under this path according to certain rules. If the backup destination has been set before, not configuring this option here will adopt the previous configuration; if no backup destination was set before, not configuring this option will default to empty. |
| -m/--backup_mode | No | string | full | The data backup mode. Valid values: full and incremental, indicating full backup and incremental backup, respectively. |
| -c/--log_archive_concurrency | No | int | None | Set the total number of worker threads for log archiving. |
| -b/--binding | No | string | Optional | The priority mode for binding archives and business requests. Valid values: Optional (business request priority) and Mandatory (archive priority). If this option is not specified, the default value Optional takes effect. |
| -i/--piece_switch_interval | No | string | None | Used to configure the switching cycle of pieces, with a value range of [1d, 7d]. |
| -e/--encryption | No | string | None | Set a password for the backup set after backup. If this option is set, the password is required when using this backup set for restoration, and the password cannot be deleted. |
| -l/--archive_lag_target | No | string | None | Controls the lag time for tenant log archiving. If you need to modify it, ensure the configuration of the log archiving destination is completed. |
| -D/--delete_policy | No | string | default | The cleanup strategy. A tenant with a cleanup strategy will trigger an automatic cleanup every hour. Currently, only the value default is supported, indicating that automatic cleanup is limited to the backup within -u/--backup_base_uri. |
| -r/--delete_recovery_window | No | string | None | Controls the time window during which backup data can be recovered. A time unit must be included when setting this option. For more information on using this option, refer to Introduction to Backup Cleanup Related Parameters. |
| -s/--ha_low_thread_score | No | int | None | Specifies the current number of working threads for low-priority tasks such as backup and backup cleanup. The value range is [0, 100]. |
| -P/--plus_archive | No | None | None | Controls whether to back up archived logs together during the data backup process without requiring a value. After adding this option, a complete dataset with archived logs will be generated in the final backup directory. |
obshell tenant backup
You can use this command to set backup-related configurations for a tenant and perform a backup.
${home_path}/bin/obshell tenant backup <tenant_name> [flags]
# example
/home/admin/oceanbase/bin/obshell tenant backup t1 -d /path/to/backup/data --backup_mode incremental --encryption MySecretPassword
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 be backed up.
The options are described as follows:
Option |
Required |
Type |
Default value |
Description |
|---|---|---|---|---|
| -d/--data_backup_uri | No | string | None | Set the data backup destination for the tenant. If the backup destination has been set before, the previous configuration will be used if this option is not configured here; if the backup destination has not been set before, the default will be empty if this option is not configured here. |
| -a/--archive_log_uri | No | string | None | Set the log archive destination for the tenant. If the log archive destination has been set before, not configuring this option will adopt the previous setting; if the log archive destination has not been set before, not configuring this option will default to empty. |
| -m/--backup_mode | No | string | full | The data backup mode. Valid values: full and incremental. These values indicate full backup (full) and incremental backup (incremental), respectively. |
| -c/--log_archive_concurrency | No | int | None | Total number of worker threads for log archiving. |
| -b/--binding | No | string | Optional | Specifies the priority mode for binding archive logs and business requests. Valid values: Optional (business requests take precedence) and Mandatory (log archiving takes precedence). If this option is not specified, the default value Optional takes effect. |
| -i/--piece_switch_interval | No | string | None | Used to configure the switching cycle of pieces, with a value range of [1d, 7d]. |
| -e/--encryption | No | string | None | Set a password for the backup set after backup. If this option is set, the password needs to be entered when using this backup set for restoration, and the password cannot be deleted. |
| -l/--archive_lag_target | No | string | None | Controls the lag time for tenant log archiving. If you need to modify it, ensure the configuration of the log archiving destination is completed. |
| -D/--delete_policy | No | string | default | The cleanup strategy. A tenant with a cleanup strategy will trigger an automatic cleanup every hour. Currently, only the value default is supported. It specifies to automatically cleanup only the backups in -d/--data_backup_uri and -a/--archive_log_uri. |
| -r/--delete_recovery_window | No | string | None | Controls the time window for backup data recovery, and a time unit is required when setting it. For the usage of this option, please refer to Introduction to Backup Cleanup Related Parameters. |
| -s/--ha_low_thread_score | No | int | None | Specifies the current number of working threads for low-priority tasks such as backup and backup cleanup. The value range is [0, 100]. |
| -P/--plus_archive | No | None | None | Controls whether to back up archived logs together during the data backup process without requiring a value. After adding this option, a complete dataset with archived logs will be generated in the final backup directory. |
obshell backup show
You can use this command to list all backup tasks or a specified tenant's backup tasks.
${home_path}/bin/obshell backup show [flags]
# example
/home/admin/oceanbase/bin/obshell backup show -d
home_path is the installation directory of OceanBase Database. obshell is located in the bin directory of OceanBase Database.
Option |
Required |
Type |
Default value |
Description |
|---|---|---|---|---|
| -t/--tenant_name | No | string | None | Specify the name of a tenant for which backup tasks need to be displayed. If not set, backup tasks of all tenants in the cluster will be displayed. |
| -d/--show_detail | No | None | None | Controls whether to display detailed information of the backup task, no value needs to be passed. |
