Purpose
You can use this statement to configure a backup destination for a user tenant. The backup destination is a data backup path.
The sys tenant and meta tenants do not support backup and restore. You do not need to configure backup destinations for them.
Required privileges
Only the root user of the sys tenant (root@sys) or the administrator user of a user tenant can execute this statement.
- The default administrator user in MySQL mode is
root. - The default administrator user in Oracle mode is
SYS.
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 Network File System (NFS), Alibaba Cloud Object Storage Service (OSS), Tencent Cloud Object Storage (COS), and Amazon Simple Storage Service (S3) as the backup media. Examples of data_backup_path are provided below. When you use OSS, COS, or S3 as the backup media, you can set the delete_mode parameter to configure the cleanup mode for backup files. Append the delete_mode parameter to the backup path by using an ampersand (&). The delete_mode parameter has two values:
|
| tenant_name | The name of the tenant for which you want to configure a backup destination. This parameter is used in the sys tenant.
NoticeWhen you execute this statement in the |
The following examples show how to configure data backup destinations in OceanBase Database when NFS, OSS, COS, and S3 are used as the backup media.
Parameter examples
Example of data_backup_path for NFS backup
ALTER SYSTEM SET DATA_BACKUP_DEST = 'nfs://your-nfs-server/your-backup-path' [TENANT = your-tenant-name];
data_backup_path consists of the following parts:
nfs://your-nfs-server/your-backup-path: the path of the NFS server accessible to OceanBase Database, which stores data backups.
Example of data_backup_path for OSS backup
ALTER SYSTEM SET DATA_BACKUP_DEST = 'oss://your-bucket-name/your-archive-path?host=oss-your-region.aliyuncs.com&access_id=your-access-id&access_key=your-access-key' [TENANT = your-tenant-name];
data_backup_path consists of the following parts:
oss://your-oss-bucket-name/your-backup-path: the name of the OSS bucket and the backup path, which stores data backups.host=oss-your-region.aliyuncs.com: the domain name used to access OSS.your-regionmust be replaced with the actual OSS region code.access_id=your-access-idandaccess_key=your-access-key: the AccessKey ID and AccessKey secret used for authentication.
Example of data_backup_path for COS backup
ALTER SYSTEM SET DATA_BACKUP_DEST = 'cos://your-bucket-name/your-archive-path?host=cos.your-region.myqcloud.com&access_id=your-access-id&access_key=your-access-key&appid=your-appid' [TENANT = your-tenant-name];
data_backup_path consists of the following parts:
cos://your-cos-bucket-name/your-backup-path: the name of the COS bucket and the backup path, which stores data backups.host=cos.your-region.myqcloud.com: the domain name used to access COS.your-regionmust be replaced with the actual COS region code.access_id=your-access-idandaccess_key=your-access-key: the AccessKey ID and AccessKey secret used for authentication.appid=your-appid: the AppID of your Tencent Cloud account.
Example of data_backup_path for S3 backup
ALTER SYSTEM SET DATA_BACKUP_DEST = 's3://your-bucket-name/your-archive-path?host=s3.your-region.amazonaws.com&access_id=your-access-id&access_key=your-access-key&s3_region=your-s3-region' [TENANT = your-tenant-name];
data_backup_path consists of the following parts:
s3://your-s3-bucket-name/your-backup-path: the name of the S3 bucket and the backup path, which stores data backups.host=s3.your-region.amazonaws.com: the domain name used to access S3.your-regionmust be replaced with the actual AWS region code.access_id=your-access-idandaccess_key=your-access-key: the AccessKey ID and AccessKey secret for AWS.s3_region=your-s3-region: the region where the S3 bucket is deployed.
Examples
systenantIn the
systenant, configure a backup destination for themysql_tenanttenant. Specifically, set the destination path to an NFS path.obclient [oceanbase]> ALTER SYSTEM SET DATA_BACKUP_DEST = 'file:///data/nfs/backup/data' TENANT = mysql_tenant;In the
systenant, configure a backup destination for themysql_tenanttenant. Specifically, set the destination path to an OSS path and the cleanup mode for backup files 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;In the
systenant, configure a backup destination for themysql_tenanttenant. Specifically, set the destination path to a COS path and the cleanup mode for backup files 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;Here,
appidindicates the AppID of your Tencent Cloud account.In the
systenant, configure a backup destination for themysql_tenanttenant. Specifically, set the destination path to an S3 path and the cleanup mode for backup files totagging.obclient [oceanbase]> ALTER SYSTEM SET DATA_BACKUP_DEST='s3://oceanbase-test-bucket/backup/data?host=s3.<region>.amazonaws.com&access_id=xxx&access_key=xxx&s3_region=xxx&delete_mode=tagging' TENANT = mysql_tenant;Here,
s3_regionindicates the region where the S3 bucket is deployed.
User tenant
In the
mysql_tenanttenant, configure a backup destination for the current tenant. Specifically, set the destination path to an NFS path.obclient [oceanbase]> ALTER SYSTEM SET DATA_BACKUP_DEST = 'file:///data/nfs/backup/data';In the
mysql_tenanttenant, configure a backup destination for the current tenant. Specifically, set the destination path to an OSS path and the cleanup mode for backup files 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';In the
oracle_tenanttenant, configure a backup destination for the current tenant. Specifically, set the destination path to a COS path and the cleanup mode for backup files 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';Here,
appidindicates the AppID of your Tencent Cloud account.In the
mysql_tenanttenant, configure a backup destination for the current tenant. Specifically, set the destination path to an S3 path and the cleanup mode for backup files totagging.obclient [oceanbase]> ALTER SYSTEM SET DATA_BACKUP_DEST='s3://oceanbase-test-bucket/backup/data?host=s3.<region>.amazonaws.com&access_id=xxx&access_key=xxx&s3_region=xxx&delete_mode=tagging';Here,
s3_regionindicates the region where the S3 bucket is deployed.