Purpose
You can use this statement to create a directory.
Note
To create a directory, you must have the CREATE ANY DIRECTORY privilege.
Syntax
CREATE [ OR REPLACE ] DIRECTORY directory AS 'path_name' ;
Parameters
| Parameter | Description |
|---|---|
| OR REPLACE | After OR REPLACE is specified, if the specified directory name already exists, a new file system path replaces the original directory definition. |
| directory | The name of the directory to be created, in a maximum of 30 bytes. |
| path_name | The absolute path where the shared file system is located. The path name is case-sensitive. Note: OceanBase Database does not create paths for users in the file system. Therefore, ensure that the path is real when you specify path_name. |
Examples
Create a directory named sql_file_dir.
obclient> CREATE OR REPLACE DIRECTORY sql_file_dir AS '/usr/sqldump';
Query OK, 1 row affected