Purpose
This statement is used to modify the attributes of a Location object.
Privilege requirements
Execution privilege:
To execute the
ALTER LOCATIONstatement, the current user must have theCREATE LOCATIONprivilege. For more information about OceanBase AI Database privileges, see Permission classification.Authentication credential privilege:
The provided
ACCESSIDandACCESSKEYmust have legitimate access permissions for the target storage service.
Syntax
ALTER LOCATION location_name SET
{URL = 'file_path'
| CREDENTIAL = (credential_list)
};
credential_list:
ACCESSID = 'string'
ACCESSKEY = 'string'
HOST = 'string'
[S3_REGION = 'string']
[PRINCIPAL = 'string']
[KEYTAB = 'string']
[KRB5CONF = 'string']
[CONFIGS = 'string']
[USERNAME = 'string']
Parameters
Parameters |
Description |
|---|---|
| location_name | The name of the Location object to be modified. |
| URL = 'file_path' | Used to modify the external storage path. For more information, see file_path. |
| CREDENTIAL | Information required to modify the access path for HDFS or object storage. For details, see credential_list below. |
file_path
The paths for storing external table files are in the following formats:
Local path format:
URL = 'file://local_file_path', wherelocal_file_pathcan be a relative or absolute path.HDFS path format:
URL = 'hdfs://localhost:port/PATH', wherelocalhostis the HDFS address,portis the HDFS port number, andPATHis the directory path in HDFS.Object Storage Service (S3) path format:
URL = 's3://bucket/remote_file_path'.The current version temporarily supports existing
oss://format paths (addresses in historical metadata can be parsed normally). When creating new object storage locations, please uses3://; compatibility may be removed in future versions. If thehostin existing configurations is still a native OSS endpoint, it needs to be updated to an S3-compatible endpoint.
Note
The path for creating a Location object should not contain parameters.
credential_list
ACCESSID: the AccessKey ID of the user used to access object storage.ACCESSKEY: the AccessKey secret for accessing object storage.HOST: the host address for modifying the object storage service.S3_REGION: Optional. The service region for the S3 object storage.PRINCIPAL: Optional. When the target HDFS cluster has a Kerberos environment, this parameter specifies the user for login authentication.KEYTAB: Optional. The path to the authentication keytab file when the target HDFS cluster has a Kerberos environment.KRB5CONF: Optional. When the target HDFS cluster has a Kerberos environment, use this parameter to specify the file path for the Kerberos environment.CONFIGS: Optional. When the target HDFS cluster has a Kerberos environment, use this parameter to modify additional cluster parameters.USERNAME: Optional. When the target HDFS cluster has a Kerberos environment, this parameter is used to modify the unique identifier of the user.
Examples
Modify the CREDENTIAL information of the test_location_oss Location object.
obclient> CREATE LOCATION test_location_oss
URL = 's3://dir'
CREDENTIAL = (
ACCESSID = '******'
ACCESSKEY = '******'
HOST = '******'
);
References
For more information about viewing file information under a location object, see SHOW.