Purpose
You can use the ALTER SYSTEM SET DATA_BACKUP_DEST statement to configure a backup destination, namely, a data backup path, for a user tenant.
Limitations and considerations
The backup and restore feature is not supported for the
systenant and meta tenants. Therefore, you do not need to configure a backup destination for them.OceanBase Database allows you to use Network File System (NFS), Alibaba Cloud Object Storage Service (OSS), Tencent Cloud Object Storage (COS), Amazon Simple Storage Service (S3), and other object storage services that are compatible with the S3 protocol, such as Huawei Object Storage Service (OBS) and Google Cloud Storage (GCS), as the backup media. Some backup media can be used only after certain basic requirements are met. For more information about backup media, see Introduction to physical backup and restore.
Required privileges
You must execute this statement as the root user of the sys tenant (namely, root@sys) or as the administrator of a user tenant.
- In MySQL mode, the default administrator is the
rootuser. - In Oracle mode, the default administrator is the
SYSuser.
Syntax
ALTER SYSTEM SET DATA_BACKUP_DEST = 'data_backup_path' [TENANT = tenant_name];
Parameters
| Parameter | Description |
|---|---|
| data_backup_path | The data backup path. OceanBase Database allows you to use NFS, Alibaba Cloud OSS, Tencent Cloud COS, Amazon S3, and other object storage services that are compatible with the S3 protocol, such as Huawei OBS and Google GCS, as the backup media. $des:// specifies the type of the backup media and is followed by the bucket name and path. The question mark (?) is used to separate other parameters of the path. host specifies the host address of the backup media, namely, the endpoint (without the bucket name) of the bucket. access_id and access_key specify the AccessKey pair of the backup media. appid is required when Tencent Cloud COS is used as the backup media and specifies the APPID of the Tencent Cloud account. Note that this parameter is not required if you specify to use Tencent Cloud COS through the S3 protocol. addressing_model is optional when an object storage service compatible with the S3 protocol is used as the backup media and specifies the URL of the object storage service. Valid values:
delete_mode is optional when Alibaba Cloud OSS or Tencent Cloud COS is used as the backup media, and specifies the cleanup mode of backup files. delete_mode is concatenated with the backup path by using an ampersand (&). Valid values:
|
| tenant_name | The name of the tenant for which a backup destination is to be configured from the sys tenant.
NoticeYou must use the |
Examples
systenantConfigure a backup destination for the
mysql_tenanttenant from thesystenant. Specifically, set the backup destination to an NFS path.obclient [oceanbase]> ALTER SYSTEM SET DATA_BACKUP_DEST = 'file:///data/nfs/backup/data' TENANT = mysql_tenant;Configure a backup destination for the
mysql_tenanttenant from thesystenant. Specifically, set the backup destination to an OSS path and set the backup file cleanup mode todelete.obclient [oceanbase]> ALTER SYSTEM SET DATA_BACKUP_DEST = 'oss://oceanbase-test-bucket/backup/?host=xxx.aliyun-inc.com&access_id=xxx&access_key=xxx&delete_mode=delete' TENANT = mysql_tenant;Configure a backup destination for the
mysql_tenanttenant from thesystenant. Specifically, set the backup destination to a COS path and set the backup file cleanup mode todelete.obclient [oceanbase]> ALTER SYSTEM SET DATA_BACKUP_DEST = 'cos://oceanbase-test-bucket/backup/?host=cos.ap-xxx.myqcloud.com/&access_id=xxx&access_key=xxx&appid=xxx&delete_mode=delete' TENANT = mysql_tenant;
User tenant
Configure a backup destination for the
mysql_tenanttenant from the current tenant. Specifically, set the backup destination to an NFS path.obclient [oceanbase]> ALTER SYSTEM SET DATA_BACKUP_DEST = 'file:///data/nfs/backup/data';Configure a backup destination for the
mysql_tenanttenant from the current tenant. Specifically, set the backup destination to an OSS path and set the backup file cleanup mode todelete.obclient [oceanbase]> ALTER SYSTEM SET DATA_BACKUP_DEST = 'oss://oceanbase-test-bucket/backup/?host=xxx.aliyun-inc.com&access_id=xxx&access_key=xxx&delete_mode=delete';Configure a backup destination for the
oracle_tenanttenant from the current tenant. Specifically, set the backup destination to a COS path and set the backup file cleanup mode todelete.obclient [SYS]> ALTER SYSTEM SET DATA_BACKUP_DEST = 'cos://oceanbase-test-bucket/backup/?host=cos.ap-xxx.myqcloud.com/&access_id=xxx&access_key=xxx&appid=xxx&delete_mode=delete';