Purpose
This statement is used to modify the source configuration of the backup or archive path for the current tenant, such as the zone, idc, or region. After modification, the new configuration will overwrite the original one.
Limitations and considerations
Only user tenants can execute this statement. System tenants (sys tenants) cannot execute this statement.
Before modifying the
zone,idc, orregionconfiguration of the path, if you need to set the region or IDC level, you need to use theALTER SYSTEM MODIFY ZONE zone_name SET REGION=region_name;orALTER SYSTEM MODIFY ZONE zone_name SET IDC=idc_name;statement to set the region or IDC information respectively. It is recommended to set the source configuration at the IDC level. This allows you to utilize an IDC with abundant network bandwidth resources for backup tasks, providing more optional nodes for the tasks, and you do not need to be concerned about changes in zones within the IDC of the cluster.When modifying the source configuration of the backup path, if a backup task is currently running, the running task will take at least a few minutes to detect the configuration changes. Therefore, during the configuration modification, there may still be nodes outside the new configuration accessing the backup path, resulting in cross-data center or cross-region traffic.
Privilege requirements
The user executing this statement must have the ALTER SYSTEM privilege. For more information about OceanBase Database privileges, see Privilege types in MySQL mode.
Syntax
ALTER SYSTEM {ALTER|CHANGE|MODIFY} EXTERNAL_STORAGE_DEST PATH [=] 'path' SET ATTRIBUTE = '{zone=zone_name | idc=idc_name | region=region_name}';
Parameters
| Parameter | Description |
|---|---|
| path | Specifies the backup or archive path to be modified. If the archive medium is an object storage type, it also needs to include the host address and access key of the object storage. For example, when the archive medium is OSS, the path format is as follows:
|
| zone=zone_name | idc=idc_name | region=region_name | Specifies the source of the current backup or archive path. You can choose configurations at the zone, idc, or region level. You can only select one level or not set any. If not explicitly specified, it will default to not being set.When modifying the source configuration of the archive path:
When modifying the source configuration of the backup path:
|
Examples
Modify the source configuration of the archive path.
Assume that the original source configuration of the archive path is
zone=z1,z2,z3. You need to change the source configuration toregion=region1. After the modification, only nodes inregion1can access the path.OSS
obclient> ALTER SYSTEM MODIFY EXTERNAL_STORAGE_DEST PATH='oss://oceanbase-test-bucket/backup/archive?host=****.aliyun-inc.com' SET ATTRIBUTE = 'region=region1';NFS
obclient> ALTER SYSTEM MODIFY EXTERNAL_STORAGE_DEST PATH='file:///data/nfs/backup/archive' SET ATTRIBUTE = 'region=region1';S3
obclient> ALTER SYSTEM CHANGE EXTERNAL_STORAGE_DEST PATH='s3://oceanbase-test-bucket/backup/archive?host=s3.<region>.amazonaws.com' SET ATTRIBUTE = 'region=region1';Object storage services that support the S3 protocol (OBS, GCS, and COS)
obclient> ALTER SYSTEM CHANGE EXTERNAL_STORAGE_DEST PATH='s3://oceanbase-test-bucket/backup/archive?host=obs.****.myhuaweicloud.com' SET ATTRIBUTE = 'region=region1';obclient> ALTER SYSTEM MODIFY EXTERNAL_STORAGE_DEST PATH='s3://oceanbase-test-bucket/backup/archive?host=https://storage.googleapis.com' SET ATTRIBUTE = 'region=region1';obclient> ALTER SYSTEM ALTER EXTERNAL_STORAGE_DEST PATH='s3://oceanbase-test-bucket/backup/archive?host=cos.ap-xxxx.myqcloud.com' SET ATTRIBUTE = 'region=region1';
Modify the source configuration of the backup path.
Assume that the original source configuration of the backup path is
zone=z1,z2;z3. You need to change the source configuration toidc=idc1;idc2. After the modification, nodes inidc1andidc2can access the path.idc1has a higher priority thanidc2.OSS
obclient> ALTER SYSTEM CHANGE EXTERNAL_STORAGE_DEST PATH='oss://oceanbase-test-bucket/backup/data?host=****.aliyun-inc.com' SET ATTRIBUTE = 'idc=idc1;idc2';NFS
obclient> ALTER SYSTEM ALTER EXTERNAL_STORAGE_DEST PATH='file:///data/nfs/backup/data' SET ATTRIBUTE = 'idc=idc1;idc2';S3
obclient> ALTER SYSTEM MODIFY EXTERNAL_STORAGE_DEST PATH='s3://oceanbase-test-bucket/backup/data?host=s3.<region>.amazonaws.com' SET ATTRIBUTE = 'idc=idc1;idc2';Object storage services that support the S3 protocol (OBS, GCS, and COS)
obclient> ALTER SYSTEM CHANGE EXTERNAL_STORAGE_DEST PATH='s3://oceanbase-test-bucket/backup/data?host=obs.****.myhuaweicloud.com' SET ATTRIBUTE = 'idc=idc1;idc2';obclient> ALTER SYSTEM ALTER EXTERNAL_STORAGE_DEST PATH='s3://oceanbase-test-bucket/backup/data?host=https://storage.googleapis.com' SET ATTRIBUTE = 'idc=idc1;idc2';obclient> ALTER SYSTEM MODIFY EXTERNAL_STORAGE_DEST PATH='s3://oceanbase-test/backup/data?host=cos.ap-xxxx.myqcloud.com' SET ATTRIBUTE = 'idc=idc1;idc2';