Tuesday, 5 August 2014

ORACLE DIRECTORY OBJECT


1-Creation

CREATE OR REPLACE DIRECTORY bfile_dir AS '/LOB/files';

2-Grant/Revoke

GRANT READ/WRITE ON DIRECTORY dir1 TO user1;
REVOKE READ/WRITE ON DIRECTORY dir1 FROM user1;

3-Data Dictionary table:

SELECT * FROM dba_directories;

4-Drop Directory:

DROP DIRECTORY ctemp;

Note that:
1- If you create the directory with a path, oracle will not verify is this path actually exist on file system or not.
2- Oracle user should have permission on physical path for read and write.
3- The Directory Objects are owned by SYS user.

Photo: ORACLE DIRECTORY OBJECT

1-Creation

CREATE OR REPLACE DIRECTORY bfile_dir AS '/LOB/files';

2-Grant/Revoke

GRANT READ/WRITE ON DIRECTORY dir1 TO user1;
REVOKE READ/WRITE ON DIRECTORY dir1 FROM user1;

3-Data Dictionary table:

SELECT * FROM dba_directories;

4-Drop Directory:

DROP DIRECTORY ctemp;

Note that:
1- If you create the directory with a path, oracle will not verify is this path actually exist on file system or not.
2- Oracle user should have permission on physical path for read and write.
3- The Directory Objects are owned by SYS user.