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.
The backup and restore feature is not supported for the sys tenant and meta tenants. Therefore, you do not need to configure a backup destination for them.
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.
- The default administrator is the
rootuser in MySQL mode. - The default administrator is the
SYSuser in Oracle mode.
Syntax
ALTER SYSTEM SET DATA_BACKUP_DEST = 'data_backup_path' [TENANT = tenant_name];
Parameters
| Parameter | Description |
|---|---|
| data_backup_path | The data backup path. At present, OceanBase Database supports Network File System (NFS), Alibaba Cloud Object Storage Service (OSS), and Tencent Cloud Object Storage (COS) as the backup media. When you use OSS or COS as the backup media, you can use the delete_mode parameter behind the backup path to configure the backup file cleanup mode. Join the delete_mode parameter and the backup path with an ampersand (&). Valid values of delete_mode:
|
| 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
sys tenant
Configure a backup destination for the
mysql_tenanttenant from the sys tenant. Use NFS as the backup media.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 the sys tenant. Use OSS as the backup media 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 the sys tenant. Use COS as the backup media 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. Use NFS as the backup media.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. Use OSS as the backup media 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. Use COS as the backup media 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';