Tuesday, September 16, 2008

DBA_DIRECTORIES

Thank you for visiting Spatial DBA - Oracle and ArcSDE.

Please visit Oracle DBA Tips (http://www.oracledbatips.com) for more Oracle DBA Tips.

==================================================================


DBA_DIRECTORIES describes all directory objects in the database. Its columns are the same as those in "ALL_DIRECTORIES".

Related View
·         ALL_DIRECTORIES describes all directories accessible to the current user.
Column
Datatype
NULL
Description
OWNER
VARCHAR2(30)
NOT NULL
Owner of the directory (always SYS)
DIRECTORY_NAME
VARCHAR2(30)
NOT NULL
Name of the directory
DIRECTORY_PATH
VARCHAR2(4000)

Operating system pathname for the directory

Note:
1.       SQL statements for directories:
System privileges
GRANT create any directory TO ;
GRANT drop any directory TO ;
Create a directory
CREATE OR REPLACE DIRECTORY AS '';
Grant read on a directory
GRANT READ ON DIRECTORY TO
Grant write on a directory
GRANT WRITE ON DIRECTORY TO
Revoke read on a directory
REVOKE READ ON DIRECTORY FROM
Revoke write on a directory
REVOKE WRITE ON DIRECTORY FROM
Drop a directory
DROP DIRECTORY ;

2.       When creating a directory, sqlplus cannot interpret environment variable ORACLE_HOME. If a directory is created (eg. create directory dpump_dir1 as '%ORACLE_HOME%\admin\dpdump';), any reference to the directory fails. Specifying environment variables in the 'create directory' statement is not a supported / documented feature. There are two reasons: 1). Different platforms like Windows, Unix and VMS specify environment variables differently. It would therefore be difficult to implement generically; 2) It is also a potential security hazard, since if it would work for $ORACLE_HOME it would also work for other environment variables, which would allow to the directory to be placed at another location on disk. Hence, the solution has to be to specify directories using a full (hardcoded) path.
3.       Example of contents of DBA_DIRECTORIES

select * from DBA_DIRECTORIES;
               
OWNER
DIRECTORY_NAME
DIRECTORY_PATH
SYS
DATA_PUMP_DIR
/oracle/product/10.2.0.1ee/rdbms/log/
SYS
ADMIN_DIR
/oracle/product/10.2.0.1ee/md/admin
SYS
TIMEZDIF_DIR
/oracle/product/10.2.0.2ee/oracore/zoneinfo


Last updated: 2009-11-02 Monday