7.4. Creating Directory Objects

Directory objects are named directory locations on the database server. Directories are used with several database features, including BFILEs, external tables, utl_file, and Data Pump. Of these, only Data Pump is germane to the certification exam.

Under Unix, you create directories with the CREATE DIRECTORY statement, like this:

CREATE DIRECTORY dump_dir AS '/oracle/data_pump/dumps';
CREATE DIRECTORY log_dir AS '/oracle/data_pump/logs';

Under Windows, you create directories like this:

CREATE DIRECTORY dpump_dir AS 'G:datadumps';

Directories are not schema objects, like tables or synonyms, as they are not owned by a schema. Instead, directories are like profiles or roles in that they are owned by the database. To control access to a directory, you need to grant the READ or WRITE object privilege on that directory, like this:

GRANT read,write ON DIRECTORY dump_dir TO PUBLIC;

To create directories, you must have the CREATE ANY DIRECTORY system privilege. By default, only users SYSTEM and SYS have this privilege. Be careful in granting this system privilege to users, because the database employs the operating system credentials of the database instance owner.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset