Purpose
This statement is used to modify the properties of a Location object.
Note
For OceanBase Database V4.4.x, ALTER LOCATION is supported starting from V4.4.1.
Privilege requirements
Execution privilege:
To execute the
ALTER LOCATIONstatement, the current user must have theCREATE LOCATIONprivilege. For more information about privileges in OceanBase Database, see Privilege types in MySQL-compatible mode.Authentication credential privilege:
The provided
ACCESSIDandACCESSKEYmust have valid 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
| Parameter | 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 below. |
| CREDENTIAL | Used to modify the information required for accessing HDFS or object storage. For more information, see credential_list below. |
file_path
The path for storing external table files can be in the following formats:
Local path:
URL = 'file://local_file_path', wherelocal_file_pathcan be a relative or absolute path.HDFS path:
URL = 'hdfs://localhost:port/PATH', wherelocalhostis the address of the HDFS cluster,portis the port number of the HDFS cluster, andPATHis the directory path in HDFS.Object storage (OSS/S3) path:
URL = '{oss | s3}://bucket/remote_file_path'.
Notice
Do not include parameters in the path when creating a Location object.
credential_list
ACCESSID: the AccessKey ID of the user for accessing object storage.ACCESSKEY: the AccessKey secret of the user for accessing object storage.HOST: the host address of the object storage service.S3_REGION: optional. The service region of the S3 object storage.PRINCIPAL: optional. The login authentication user when the target HDFS cluster is in a Kerberos environment.KEYTAB: optional. The authentication key file path when the target HDFS cluster is in a Kerberos environment.KRB5CONF: optional. The file path for using Kerberos when the target HDFS cluster is in a Kerberos environment.CONFIGS: optional. Additional cluster configuration items when the target HDFS cluster is in a Kerberos environment.USERNAME: optional. The unique identifier for the user when the target HDFS cluster is in a Kerberos environment.
Examples
Modify the CREDENTIAL information of the test_location_oss Location object.
obclient> CREATE LOCATION test_location_oss
URL = 'oss://dir'
CREDENTIAL = (
ACCESSID = '******'
ACCESSKEY = '******'
HOST = '******'
);
References
For information about viewing files under a Location object, see SHOW.