Purpose
This statement is used to delete files from an external storage location.
Note
For OceanBase Database V4.4.x, the REMOVE statement is supported starting from V4.4.1.
Limitations and considerations
Files in a local location object cannot be deleted.
Privilege requirements
To execute the REMOVE statement, the current user must have the WRITE privilege on the location object. For more information about granting the privilege on a location object to a user, see GRANT.
Syntax
REMOVE FILES IN LOCATION @location_name['/path'] [PATTERN = 'regex_pattern'];
Parameters
| Parameter | Description |
|---|---|
| location_name | The name of the target storage location, which is the name of the location object. |
| path | Optional. The subdirectory. |
| PATTERN | Optional. A regular expression used to filter the names of files to be deleted. |
Examples
Delete files in the test_location_oss location object.
obclient> REMOVE FILES IN LOCATION @test_location_oss;
References
- For more information about creating a location object, see CREATE LOCATION.
- For more information about viewing files in a location object, see SHOW.