Purpose
This statement is used to modify the properties of a Location object.
Note
For OceanBase Database V4.4.x, the ALTER LOCATION statement is supported starting from V4.4.1.
Privilege requirements
Privilege:
To execute the
ALTER LOCATIONstatement, the current user must have theCREATE LOCATIONprivilege. For more information about OceanBase Database privileges, see Privilege classification in Oracle mode.Credential:
The provided
ACCESSIDandACCESSKEYmust have valid access permissions to 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' | Specifies the external storage path. For more information, see file_path. |
| CREDENTIAL | Specifies the information required to modify the access path for HDFS or object storage. For more information, see credential_list. |
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', wherelocalhostspecifies the HDFS address,portspecifies the HDFS port number, andPATHspecifies the directory path in HDFS.Object storage (OSS/S3) path:
URL = '{oss | s3}://bucket/remote_file_path'.
Notice
The path for creating a Location object should not contain parameters.
credential_list
ACCESSID: the AccessKey ID for accessing object storage.ACCESSKEY: the AccessKey secret for accessing object storage.HOST: the host address for accessing object storage.S3_REGION: the service region for S3 object storage. This is an optional parameter.PRINCIPAL: the login user for the target HDFS cluster with Kerberos. This is an optional parameter.KEYTAB: the authentication key file path for the target HDFS cluster with Kerberos. This is an optional parameter.KRB5CONF: the file path for using Kerberos in the target HDFS cluster with Kerberos. This is an optional parameter.CONFIGS: additional cluster configurations for the target HDFS cluster with Kerberos. This is an optional parameter.USERNAME: the unique identifier for the user in the target HDFS cluster with Kerberos. This is an optional parameter.
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.
