Create & grant permission to directory in Oracle

Create, grant permission, modify, drop database directory in Oracle

Create directory in Oracle Database

Create directory dir_name as 'D:\scripts';

Grant read write permission to Directory:

--grant read permission
GRANT read on DIRECTORY dir_name to user_name;
--grant write permission
GRANT write on DIRECTORY dir_name to user_name;
-- grant both
GRANT READ,WRITE ON DIRECTORY dir_Name TO user_Name;

Revoke permission from directory

-- revoke read permission
REVOKE read on DIRECTORY dir_name FROM User_Name;
-- revoke write permission
REVOKE write on DIRECTORY dir_name FROM User_Name;
-- revoke both
REVOKE read,write on Directory dir_name from user_name;

Modify path of directory

SQL> create or replace directory dbscript as 'D:\';
Directory created.
SQL> create or replace directory dbscript as 'D:\scripts';
Directory created.

Drop the directory

DROP Directory dbscript;

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.