Description
The ALTER SYSTEM SET DATA_BACKUP_DEST statement configures a backup destination, namely, the path where data backups are stored, for a user tenant.
Backup destinations are not configured for the sys tenant or the meta tenant because these tenants do not support backup and restore.
Privilege requirements
You must use the root user of the sys tenant (root@sys) or the administrator of each tenant to execute this statement. By default:
- 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 path where data backups are stored. Currently, OceanBase Database supports storing data backups on NFS, Alibaba Cloud OSS, and Tencent Cloud COS.
NoticeIf you use object storage as the backup medium, separate the parameters of the object storage path with When you use OSS or COS as the backup medium, you can specify the delete_mode parameter after the backup path to configure the cleanup mode for backup files. The delete_mode parameter is connected to the backup path with &. Currently, the following two values are supported for the delete_mode parameter:
|
| tenant_name | The name of the tenant for which the backup destination is to be configured in the sys tenant.
NoticeOnly the sys tenant needs to use the |
Examples
System tenant
The system tenant configures the backup destination for the
mysql_tenanttenant. The backup media is NFS.obclient [oceanbase]> ALTER SYSTEM SET DATA_BACKUP_DEST = 'file:///data/nfs/backup/data' TENANT = mysql_tenant;The system tenant configures the backup destination for the
mysql_tenanttenant. The backup media is OSS. Thedeletecleanup mode is configured for the backup files.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;The system tenant configures the backup destination for the
mysql_tenanttenant. The backup media is COS. Thedeletecleanup mode is configured for the backup files.code-placeholder/27b23b98-855a-4ce-b98d-a91b602ed95d
User tenant
The
mysql_tenanttenant configures the backup destination for the current tenant. The backup media is NFS.obclient [oceanbase]> ALTER SYSTEM SET DATA_BACKUP_DEST = 'file:///data/nfs/backup/data';The
mysql_tenanttenant configures the backup destination for the current tenant. The backup media is OSS. Thedeletecleanup mode is configured for the backup files.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';The
oracle_tenanttenant configures the backup destination for the current tenant. The backup media is COS. Thedeletecleanup mode is configured for the backup files.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';