Wednesday, December 10, 2008

Directory Objects

Directory Objects

Directory Object is a logical structure that represents a physical location of a file system.

It is used in External Tables, UTL_FILE package and in Data Pump.

Important Points

  • Always owned by SYS user (Even created by another user).
  • Names must be unique.
  • You must have CREATE ANY DIRECTORY privilege to create Directory object.
  • By default the owner gets the READ WRITE privilege on the directory object.
  • Grant necessary privilege on this object if you want other user to access.
  • READ and WRITE privilege means only oracle database will read and write on behalf of a user. The user has no direct access to these files.

Creating Directory Object

SQL> Create or Replace Directory data_pump_dir As ‘/oracle/export/dpump’;

SQL> Grant Read,Write on directory data_pump_dir to public;

Data Dictionary Views

SQL> Select * from ALL_DIRECTORIES;
It returns owner, directory name and directory path.

SQL> Select * from ALL_TAB_PRIVS where privilege in (‘READ’, ‘WRITE’);
It shows whether you have required read/write privilege.

Thanks

No comments:

Followers

Powered By Blogger
 

Oracle Database Administration. Copyright 2008 All Rights Reserved Revolution Two Church theme by Brian Gardner Converted into Blogger Template by Bloganol dot com