Purpose
This statement is used to modify the source configuration (such as zone, idc, or region), I/O throttling parameters (max_iops and max_bandwidth), and key information such as access_id and access_key for the backup or archive path of the current tenant. After modification, the new configuration information will overwrite the original configuration information.
Limitations and considerations
Only user tenants can execute this statement. System tenants (sys tenants) cannot execute this statement.
Before you modify the
zone,idc, orregionconfigurations of a path, you must 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. We recommend that you set the IDC information of the source path. This way, you can use an IDC with more network bandwidth resources to perform backup tasks, and the backup tasks have more optional nodes. In addition, you do not need to pay attention to the changes in zones within an IDC in the cluster.When you modify the source configurations of a backup path, if a backup task is being executed, the task may take up to a few minutes to detect the configuration changes. During this period, nodes outside the configuration scope may still access the backup path, resulting in cross-data center or cross-region traffic.
Only object storage paths support changing the I/O throttling parameters (
max_iopsandmax_bandwidth) andaccess_idandaccess_keyinformation. If you set the I/O throttling parameters (max_iopsandmax_bandwidth) oraccess_idandaccess_keyinformation for an NFS path, the system returns an error with the error code1235.If the format of the parameters for setting the
ACCESS_INFOattribute (access_idandaccess_key) is incorrect (for example, there are extra=signs, oraccess_idoraccess_keyis missing), the system returns theOB_OBJECT_STORAGE_PERMISSION_DENIEDerror (error code-9116).When an object storage path is accessed by using the Assume Role method:
If you set
ACCESS_INFO = 'access_id=new_access_id&access_key=new_access_key', an error is returned.If you set only the I/O throttling parameters in the
ATTRIBUTEattribute without setting theACCESS_INFOattribute, the system may prompt that the setting is not supported or that the setting does not take effect.
You can set the same
ATTRIBUTE+ACCESS_INFOattribute multiple times for the same path.
Privilege requirements
The user who executes this statement must have the ALTER SYSTEM privilege. For more information about OceanBase Database privileges, see Privilege types in Oracle 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 an object storage, you must also specify the host address, access key, and other information of the object storage. 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 path or archive path. You can specify zone, idc, or region. You can specify only one of them or none. If you do not specify any, the default value is none.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 path or archive path. The value is a positive integer, indicating the number of I/O requests per second. If you do not specify this parameter, the path does not restrict IOPS. The IOPS is determined by the underlying object storage and network capabilities. Example: |
| max_bandwidth | The maximum bandwidth allowed for the current backup path or archive path. The value is a positive integer with a unit. The supported units are kb, mb, and gb, which indicate KB/s, MB/s, and GB/s, respectively. If you do not specify this parameter, the path does not restrict bandwidth. Example: |
| access_id=new_access_id&access_key=new_access_key | The new access_id and access_key after the change. You must specify both access_id and access_key. |
Examples
Change the source configuration of an archive path
Assume that the original source configuration of an archive path is zone=z1,z2,z3. You need to change the source configuration to region=region1. After the change, only the 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 CHANGE EXTERNAL_STORAGE_DEST PATH='s3://oceanbase-test-bucket/backup/archive?host=obs.****.myhuaweicloud.com' SET ATTRIBUTE = 'region=region1';obclient(SYS@oracle001)[SYS]> ALTER SYSTEM MODIFY 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 configuration of a backup path
Assume that the original source configuration of a backup path is zone=z1,z2;z3. You need to change the source configuration to idc=idc1;idc2. After the change, the nodes in idc1 and idc2 can access the backup path. The nodes in idc1 have higher priority than those in idc2.
OSS
obclient(SYS@oracle001)[SYS]> ALTER SYSTEM MODIFY 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 CHANGE EXTERNAL_STORAGE_DEST PATH='file:///data/nfs/backup/data' SET ATTRIBUTE = 'idc=idc1;idc2';S3
obclient(SYS@oracle001)[SYS]> ALTER SYSTEM ALTER 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 values of 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 values of a backup path
OSS
obclient(SYS@oracle001)[SYS]> ALTER SYSTEM MODIFY 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 CHANGE 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 ALTER 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 MODIFY 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) of an archive path
You can set the max_iops and max_bandwidth parameters at the same time, or set only the max_iops or max_bandwidth parameter. 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 only the
max_iopsparameter. 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 only the
max_bandwidthparameter. 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 (max_iops and max_bandwidth) for the backup path
Note
Recommendations for setting I/O throttling parameters:
- In a high-concurrency, bandwidth-sensitive multi-tenant environment, you can set different
max_iopsormax_bandwidthvalues for different backup paths to isolate the impact of backup on online business bandwidth and IOPS. - We recommend that you start from a low value and gradually adjust the parameters based on the actual network bandwidth and the throttling strategy of the object storage service. For example, you can set the parameters to
max_iops=500&max_bandwidth=100mbfirst, and then fine-tune the parameters based on the backup duration and business peak.
You can set both the max_iops and max_bandwidth parameters or set only one of them. Only object storage paths support setting I/O throttling parameters. NFS paths do not support setting I/O throttling parameters.
OSS
You can set both the
max_iopsandmax_bandwidthparameters. Here is an example.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';You can set only the
max_iopsparameter. Here is an example.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';You can set only the
max_bandwidthparameter. Here is an example.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
You can set both the
max_iopsandmax_bandwidthparameters. Here is an example.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)
You can set both the
max_iopsandmax_bandwidthparameters. Here is an example.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';
