How to create a directory in oracle 12c

We can create a directory in oracle 12c by using below command

CREATE [OR REPLACE] DIRECTORY directory-name AS ‘path’;

Where as
directory_name : database unique directory
path : is a OS path name. can be case sensitive if we are using unix.

Note that, directory created is not owned by schema, hence in order to access directory created, you should provide read permission to schema which intends to use directory to read files in that directory. It can be done using below command.

Command to grant access to directory to a user [ it should be done via system user] .

GRANT READ ON DIRECTORY directory-name TO userName;

 

 

Working in software industry since last 10+ years, have done feature rich web apps & automations and helped organizations to save cost.

Leave a reply: