In Oracle, a directory object corresponds to a directory on the database server's filesystem. The CREATE DIRECTORY command is used to create a directory object in Oracle, and you must have a CREATE ANY DIRECTORY privilege. The following are the examples.
Examples For Creating a Directory in Oracle
In Windows:
CREATE OR REPLACE DIRECTORY CSV_FILES AS 'C:\MY_CSV_FILES';
In Linux:
CREATE OR REPLACE DIRECTORY CSV_FILES AS '/user1/my_csv_files';
Create Directory Using Toad
Follow these steps to create a directory in Oracle using Toad
- Click on the menu Database > Create > Directory.
- Then Create Directory window will appear.
- Specify directory name in the Directory Name field.
- Specify the path in the Directory Path field, or you can browse directly there (if you are creating a directory on the server).
- Then click on OK to create the directory.
Create Directory Using Oracle SQL Developer
Follow these steps to create a directory using Oracle SQL Developer
- Navigate to the Connections navigator, open the schema node.
- Locate Directories node and do the right click.
- Click on the Create Directory option in the shortcut menu.
- Then Create Directory window will appear.
- Specify the directory name in the Directory Name field.
- Specify the path in the Directory Path field.
- Then click on the Apply button to create the directory.