CODE
Oracle Code Library
JOBS
Find Or Post Oracle Jobs
FORUM
Oracle Discussion & Chat
PSOUG Home Code Snippets Oracle Reference Oracle Functions PSOUG Forum Oracle Blogs Bookmark and Share
 
 Search the Reference Library pages:  

Free
Oracle Magazine
Subscriptions
and Oracle White Papers

Oracle Directories
Version 11.1
 
General
Related Data Dictionary Objects
dir$ all_directories ku$_directory_t
  dba_directories ku$_directory_view
System Privileges GRANT create any directory TO <user_name>;
GRANT drop any directory TO <user_name>;
GRANT create any directory TO uwclass;
GRANT drop any directory TO uwclass;
 
Create Directory

Create A Directory
CREATE OR REPLACE DIRECTORY <directory_name> AS '<operating_system_path>';
conn / as sysdba

desc dba_directories

set linesize 121
col owner format a15
col directory_name format a20
col directory_path format a70

SELECT *
FROM dba_directories;

CREATE OR REPLACE DIRECTORY
ctemp AS 'c: emp';

SELECT *
FROM dba_directories;
 
Granting Privileges To A Directory

Grant Read On A Directory
GRANT READ ON DIRECTORY <directory_name> TO <schema_name>
col grantor format a20
col grantee format a20
col table_schema format a20
col table_name format a20
col privilege format a10

SELECT grantor, grantee, table_schema, table_name, privilege
FROM all_tab_privs
WHERE table_name = 'CTEMP';

GRANT READ ON DIRECTORY
ctemp TO uwclass;

SELECT grantor, grantee, table_schema, table_name, privilege
FROM all_tab_privs
WHERE table_name = 'CTEMP';
Grant Write On A Directory GRANT WRITE ON DIRECTORY <directory_name> TO <schema_name>
GRANT WRITE ON DIRECTORY ctemp TO uwclass;

SELECT grantor, grantee, table_schema, table_name, privilege
FROM all_tab_privs
WHERE table_name = 'CTEMP';
Revoke Read On A Directory REVOKE READ ON DIRECTORY <directory_name> FROM <schema_name>
REVOKE READ ON DIRECTORY ctemp FROM uwclass;
Revoke Write On A Directory REVOKE WRITE ON DIRECTORY <directory_name> FROM <schema_name>
REVOKE WRITE ON DIRECTORY ctemp FROM uwclass;
 
Drop Directory
Drop A Directory DROP DIRECTORY <directory_name>;
SELECT *
FROM dba_directories;

DROP DIRECTORY
ctemp;

SELECT *
FROM dba_directories;
 
Related Topics
ADDM
DataPump
DBMS_FILE_TRANSFER
DBMS_HPROF
DBMS_LOB
External Tables
Intermedia Audio
Intermedia Video
Transportable Tablespaces
UTL_FILE
Home      :      Code Library      :      Sponsors      :      Privacy      :      Terms of Use      :      Contact Us [91 users online]    © 2010 psoug.org