Purpose
This statement is used to modify the source configuration (such as zone, idc, or region) of the backup or archive path, I/O throttling parameters (max_iops and max_bandwidth), and key information such as access_id and access_key for the current tenant. After the modification, the new configuration will overwrite the original configuration.
Limitations and considerations
Only user tenants can execute this statement. The sys tenant cannot execute this statement.
Before you modify the
zone,idc, orregionconfigurations of a path, if you need to set the region level or IDC level, you must first 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 information or IDC information. It is recommended to set the source configuration at the IDC level. This allows you to use an IDC with more network bandwidth resources for backup tasks, providing a wider range of optional nodes for the tasks. Additionally, you do not need to monitor changes in zones within the IDC of the cluster.When modifying the source configuration of a backup path, if a backup task is currently running, the running task may take up to a few minutes to recognize the configuration changes. During this time, nodes outside the configured scope may still access the backup path, potentially generating cross-facility or cross-regional traffic.
Only object storage paths support changing I/O throttling parameters (
max_iopsandmax_bandwidth) andaccess_idandaccess_keyinformation. If you attempt to set I/O throttling parameters (max_iopsandmax_bandwidth) oraccess_idandaccess_keyinformation for an NFS path, the system returns an unsupported error with the error code1235.When setting the
ACCESS_INFOattribute (access_idandaccess_keyinformation) for an object storage path, if the parameter format is incorrect (e.g., contains extra=signs or lacksaccess_idoraccess_key), the system returns the errorOB_OBJECT_STORAGE_PERMISSION_DENIED(error code-9116).When an object storage path uses Assume Role to access an object path:
If you set
ACCESS_INFO = 'access_id=new_access_id&access_key=new_access_key', the system returns an error.If you only set the I/O throttling parameters in
ATTRIBUTE(without setting theACCESS_INFOattribute), the system may indicate that the feature is unsupported or that the settings do not take effect.
You can set the same
ATTRIBUTE+ACCESS_INFOattributes multiple times for the same path.
Privilege requirements
The user who executes this statement must have the ALTER SYSTEM privilege. For more information about the privileges of OceanBase Database, see Privilege classification in Oracle-compatible mode.
Syntax
ALTER SYSTEM {ALTER|CHANGE|MODIFY} EXTERNAL_STORAGE_DEST
PATH [=] 'path'
SET [ATTRIBUTE = '[{zone=zone_name | idc=idc_name | region=region_name}][&max_iops=iops_num][&max_bandwidth=bandwidth_num]']
[ACCESS_INFO = 'access_id=new_access_id&access_key=new_access_key'];
Parameters
| Parameter | Description |
|---|---|
| path | The backup path or archive path to be modified. If the backup or archive medium is of the object storage type, the host address, access key, and other information of the object storage are also required. For example, when the archive medium is OSS, the path is in the oss://oceanbase-test-bucket/backup/databackup?host=xxxx format. |
| zone=zone_name | idc=idc_name | region=region_name | The source of the current backup or archive path. You can specify zone, idc, or region. You can specify only one of the three parameters or none. If you do not specify any of them, the default value is not set.When you modify the source of the archive path:
When you modify the source of the backup path:
|
| max_iops | The maximum IOPS allowed for the current backup or archive path. The value is a positive integer, indicating the number of I/O requests per second. If this parameter is not specified, the path does not limit IOPS, which is determined by the underlying object storage and network capabilities. Example: |
| max_bandwidth | The maximum bandwidth allowed for the current backup or archive path. The value is a positive integer with a unit. Supported units are kb, mb, and gb, which represent KB/s, MB/s, and GB/s, respectively. If this parameter is not specified, the path does not limit bandwidth. Example: |
| access_id=new_access_id&access_key=new_access_key | The new access_id and access_key after the change. Both access_id and access_key must be specified. |
Examples
Change the source endpoint configuration for an archive path
Assume that the original source endpoint configuration for an archive path is zone=z1,z2,z3. You need to change the source endpoint configuration to region=region1. After the change, only nodes in region1 can access the archive path.
OSS
obclient(SYS@oracle001)[SYS]> ALTER SYSTEM MODIFY EXTERNAL_STORAGE_DEST PATH='oss://oceanbase-test-bucket/backup/archive?host=****.aliyun-inc.com' SET ATTRIBUTE = 'region=region1';NFS
obclient(SYS@oracle001)[SYS]> ALTER SYSTEM MODIFY EXTERNAL_STORAGE_DEST PATH='file:///data/nfs/backup/archive' SET ATTRIBUTE = 'region=region1';S3
obclient(SYS@oracle001)[SYS]> 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 compatible with the S3 protocol (OBS, GCS, and COS)
obclient(SYS@oracle001)[SYS]> ALTER SYSTEM MODIFY EXTERNAL_STORAGE_DEST PATH='s3://oceanbase-test-bucket/backup/archive?host=obs.****.myhuaweicloud.com' SET ATTRIBUTE = 'region=region1';obclient(SYS@oracle001)[SYS]> ALTER SYSTEM CHANGE EXTERNAL_STORAGE_DEST PATH='s3://oceanbase-test-bucket/backup/archive?host=https://storage.googleapis.com' SET ATTRIBUTE = 'region=region1';obclient(SYS@oracle001)[SYS]> ALTER SYSTEM ALTER EXTERNAL_STORAGE_DEST PATH='s3://oceanbase-test-bucket/backup/archive?host=cos.ap-xxxx.myqcloud.com' SET ATTRIBUTE = 'region=region1';
Change the source endpoint configuration for a backup path
Assume that the original source endpoint configuration for a backup path is zone=z1,z2;z3. You need to change the source endpoint configuration to idc=idc1;idc2. After the change, nodes in idc1 and idc2 can access the backup path. The nodes in idc1 have a higher priority than those in idc2.
OSS
obclient(SYS@oracle001)[SYS]> ALTER SYSTEM CHANGE EXTERNAL_STORAGE_DEST PATH='oss://oceanbase-test-bucket/backup/data?host=****.aliyun-inc.com' SET ATTRIBUTE = 'idc=idc1;idc2';NFS
obclient(SYS@oracle001)[SYS]> ALTER SYSTEM ALTER EXTERNAL_STORAGE_DEST PATH='file:///data/nfs/backup/data' SET ATTRIBUTE = 'idc=idc1;idc2';S3
obclient(SYS@oracle001)[SYS]> 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 compatible with the S3 protocol (OBS, GCS, and COS)
obclient(SYS@oracle001)[SYS]> ALTER SYSTEM CHANGE EXTERNAL_STORAGE_DEST PATH='s3://oceanbase-test-bucket/backup/data?host=obs.****.myhuaweicloud.com' SET ATTRIBUTE = 'idc=idc1;idc2';obclient(SYS@oracle001)[SYS]> ALTER SYSTEM MODIFY EXTERNAL_STORAGE_DEST PATH='s3://oceanbase-test-bucket/backup/data?host=https://storage.googleapis.com' SET ATTRIBUTE = 'idc=idc1;idc2';obclient(SYS@oracle001)[SYS]> ALTER SYSTEM ALTER EXTERNAL_STORAGE_DEST PATH='s3://oceanbase-test/backup/data?host=cos.ap-xxxx.myqcloud.com' SET ATTRIBUTE = 'idc=idc1;idc2';
Change the access_id and access_key information for an archive path
OSS
obclient(SYS@oracle001)[SYS]> ALTER SYSTEM MODIFY EXTERNAL_STORAGE_DEST PATH='oss://oceanbase-test-bucket/backup/archive?host=****.aliyun-inc.com' SET ACCESS_INFO = 'access_id=******&access_key=******';S3
obclient(SYS@oracle001)[SYS]> ALTER SYSTEM CHANGE EXTERNAL_STORAGE_DEST PATH='s3://oceanbase-test-bucket/backup/archive?host=s3.<region>.amazonaws.com' SET ACCESS_INFO = 'access_id=******&access_key=******';Object storage services compatible with the S3 protocol (OBS, GCS, and COS)
obclient(SYS@oracle001)[SYS]> ALTER SYSTEM CHANGE EXTERNAL_STORAGE_DEST PATH='s3://oceanbase-test-bucket/backup/archive?host=obs.****.myhuaweicloud.com' SET ACCESS_INFO = 'access_id=******&access_key=******';obclient(SYS@oracle001)[SYS]> ALTER SYSTEM MODIFY EXTERNAL_STORAGE_DEST PATH='s3://oceanbase-test-bucket/backup/archive?host=https://storage.googleapis.com' SET ACCESS_INFO = 'access_id=******&access_key=******';obclient(SYS@oracle001)[SYS]> ALTER SYSTEM ALTER EXTERNAL_STORAGE_DEST PATH='s3://oceanbase-test-bucket/backup/archive?host=cos.ap-xxxx.myqcloud.com' SET ACCESS_INFO = 'access_id=******&access_key=******';
Change the access_id and access_key information for a backup path
OSS
obclient(SYS@oracle001)[SYS]> ALTER SYSTEM ALTER EXTERNAL_STORAGE_DEST PATH='oss://oceanbase-test-bucket/backup/data?host=****.aliyun-inc.com' SET ACCESS_INFO = 'access_id=******&access_key=******';S3
obclient(SYS@oracle001)[SYS]> ALTER SYSTEM MODIFY EXTERNAL_STORAGE_DEST PATH='s3://oceanbase-test-bucket/backup/data?host=s3.<region>.amazonaws.com' SET ACCESS_INFO = 'access_id=******&access_key=******';Object storage services compatible with the S3 protocol (OBS, GCS, and COS)
obclient(SYS@oracle001)[SYS]> ALTER SYSTEM CHANGE EXTERNAL_STORAGE_DEST PATH='s3://oceanbase-test-bucket/backup/data?host=obs.****.myhuaweicloud.com' SET ACCESS_INFO = 'access_id=******&access_key=******';obclient(SYS@oracle001)[SYS]> ALTER SYSTEM MODIFY EXTERNAL_STORAGE_DEST PATH='s3://oceanbase-test-bucket/backup/data?host=https://storage.googleapis.com' SET ACCESS_INFO = 'access_id=******&access_key=******';obclient(SYS@oracle001)[SYS]> ALTER SYSTEM ALTER EXTERNAL_STORAGE_DEST PATH='s3://oceanbase-test/backup/data?host=cos.ap-xxxx.myqcloud.com' SET ACCESS_INFO = 'access_id=******&access_key=******';
Set the I/O throttling parameters (max_iops and max_bandwidth) for an archive path
You can set the max_iops and max_bandwidth parameters at the same time or set one of the parameters separately. You can set the I/O throttling parameters only for object storage paths. You cannot set the I/O throttling parameters for NFS paths.
OSS
Set the
max_iopsandmax_bandwidthparameters at the same time. Example:obclient(SYS@oracle001)[SYS]> ALTER SYSTEM MODIFY EXTERNAL_STORAGE_DEST PATH='oss://oceanbase-test-bucket/backup/archive?host=****.aliyun-inc.com' SET ATTRIBUTE = 'max_iops=1000&max_bandwidth=1000mb';Set the
max_iopsparameter separately. Example:obclient(SYS@oracle001)[SYS]> ALTER SYSTEM MODIFY EXTERNAL_STORAGE_DEST PATH='oss://oceanbase-test-bucket/backup/archive?host=****.aliyun-inc.com' SET ATTRIBUTE = 'max_iops=1000';Set the
max_bandwidthparameter separately. Example:obclient(SYS@oracle001)[SYS]> ALTER SYSTEM MODIFY EXTERNAL_STORAGE_DEST PATH='oss://oceanbase-test-bucket/backup/archive?host=****.aliyun-inc.com' SET ATTRIBUTE = 'max_bandwidth=1000mb';S3
Set the
max_iopsandmax_bandwidthparameters at the same time. Example:obclient(SYS@oracle001)[SYS]> ALTER SYSTEM CHANGE EXTERNAL_STORAGE_DEST PATH='s3://oceanbase-test-bucket/backup/archive?host=s3.<region>.amazonaws.com' SET ATTRIBUTE = 'max_iops=1000&max_bandwidth=1000mb';Object storage services compatible with the S3 protocol (OBS, GCS, and COS)
Set the
max_iopsandmax_bandwidthparameters at the same time. Example:obclient(SYS@oracle001)[SYS]> ALTER SYSTEM CHANGE EXTERNAL_STORAGE_DEST PATH='s3://oceanbase-test-bucket/backup/archive?host=obs.****.myhuaweicloud.com' SET ATTRIBUTE = 'max_iops=1000&max_bandwidth=1000mb';obclient(SYS@oracle001)[SYS]> ALTER SYSTEM MODIFY EXTERNAL_STORAGE_DEST PATH='s3://oceanbase-test-bucket/backup/archive?host=https://storage.googleapis.com' SET ATTRIBUTE = 'max_iops=1000&max_bandwidth=1000mb';obclient(SYS@oracle001)[SYS]> ALTER SYSTEM ALTER EXTERNAL_STORAGE_DEST PATH='s3://oceanbase-test-bucket/backup/archive?host=cos.ap-xxxx.myqcloud.com' SET ATTRIBUTE = 'max_iops=1000&max_bandwidth=1000mb';
Set the I/O throttling parameters for the backup path (max_iops and max_bandwidth)
Note
Recommendations for setting I/O throttling parameters:
- In a highly concurrent, bandwidth-sensitive multi-tenant environment, you can set different
max_iopsormax_bandwidthparameters for different backup paths to isolate the impact of backups on online business bandwidth and IOPS. - We recommend that you start with lower values and gradually adjust them based on your actual network bandwidth and object storage throttling strategy. For example, you can start by setting
max_iops=500&max_bandwidth=100mband then fine-tune the values based on the backup duration and business peak times.
You can set both the max_iops and max_bandwidth parameters, or set only one of them. I/O throttling parameters can be set only for object storage paths, not for NFS paths.
OSS
The following example shows how to set both the
max_iopsandmax_bandwidthparameters.obclient(SYS@oracle001)[SYS]> ALTER SYSTEM MODIFY EXTERNAL_STORAGE_DEST PATH='oss://oceanbase-test-bucket/backup/data?host=****.aliyun-inc.com' SET ATTRIBUTE = 'max_iops=1000&max_bandwidth=1000mb';The following example shows how to set only the
max_iopsparameter.obclient(SYS@oracle001)[SYS]> ALTER SYSTEM MODIFY EXTERNAL_STORAGE_DEST PATH='oss://oceanbase-test-bucket/backup/data?host=****.aliyun-inc.com' SET ATTRIBUTE = 'max_iops=1000';The following example shows how to set only the
max_bandwidthparameter.obclient(SYS@oracle001)[SYS]> ALTER SYSTEM MODIFY EXTERNAL_STORAGE_DEST PATH='oss://oceanbase-test-bucket/backup/data?host=****.aliyun-inc.com' SET ATTRIBUTE = 'max_bandwidth=1000mb';S3
The following example shows how to set both the
max_iopsandmax_bandwidthparameters.obclient(SYS@oracle001)[SYS]> ALTER SYSTEM CHANGE EXTERNAL_STORAGE_DEST PATH='s3://oceanbase-test-bucket/backup/data?host=s3.<region>.amazonaws.com' SET ATTRIBUTE = 'max_iops=1000&max_bandwidth=1000mb';Object storage services compatible with the S3 protocol (OBS, GCS, and COS)
The following example shows how to set both the
max_iopsandmax_bandwidthparameters.obclient(SYS@oracle001)[SYS]> ALTER SYSTEM CHANGE EXTERNAL_STORAGE_DEST PATH='s3://oceanbase-test-bucket/backup/data?host=obs.****.myhuaweicloud.com' SET ATTRIBUTE = 'max_iops=1000&max_bandwidth=1000mb';obclient(SYS@oracle001)[SYS]> ALTER SYSTEM ALTER EXTERNAL_STORAGE_DEST PATH='s3://oceanbase-test-bucket/backup/data?host=https://storage.googleapis.com' SET ATTRIBUTE = 'max_iops=1000&max_bandwidth=1000mb';obclient(SYS@oracle001)[SYS]> ALTER SYSTEM MODIFY EXTERNAL_STORAGE_DEST PATH='s3://oceanbase-test/backup/data?host=cos.ap-xxxx.myqcloud.com' SET ATTRIBUTE = 'max_iops=1000&max_bandwidth=1000mb';