Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: create directory privilege

Re: create directory privilege

From: Thomas Kyte <tkyte_at_us.oracle.com>
Date: 1998/11/18
Message-ID: <36542498.2816810@192.86.155.100>#1/1

A copy of this was sent to satar_at_my-dejanews.com (if that email address didn't require changing) On Wed, 18 Nov 1998 00:35:51 GMT, you wrote:

>Excuse the Ignorance, does such a thing even exists? Please explain what
>"Create directory" means. Is this a new system privilege in Oracle 8?
>

the directory object is new to Oracle8.

it is used to create 'diretory objects' in the database. These directory objects are used with BFILES (binary files) to map an OS directory into the database. Once you have a directory object in the database pointing to an OS directory, you can use BFILE functions to open files in a binary mode in that directory for reading. For example, this is a great way to load files into blobs in the database, for example:

SQL> create table blobs

  2  ( id            varchar2(255),
  3    theBlob       blob

  4 )
  5 /

Table created.

SQL>
SQL> create or replace directory MY_FILES as '/export/home/tkyte/public_html'; Directory created.

SQL>
SQL> declare

  2          l_bfile bfile;
  3          l_blob  blob;
  4  begin
  5          insert into blobs values ( 'alan.tif', empty_blob() )
  6          return theBlob into l_blob;
  7  
  7          l_bfile := bfilename( 'MY_FILES', 'alan.tif' );
  8          dbms_lob.fileopen( l_bfile );
  9          dbms_lob.loadfromfile( l_blob, l_bfile, dbms_lob.getlength(l_bfile)
);
 10          commit;

 11 end;
 12 /
PL/SQL procedure successfully completed.

that read the file alan.tif from my directory into my database table..

>- Satar
>
>In article <AB5sMKsK42_at_protasov.kiev.ua>,
> oracle_at_protasov.kiev.ua wrote:
>>
>> Hi,
>>
>> grant create any directory to username;
>>
>> Andrew Protasov
>>
>> > Does anyone know how to grant to a user the privilege to create
>> > directory aliases(with the create directory command)?
>> >
>> > Thanks in advance.
>> > Please mail to me
>> >
>> > --
>> > Vagelis S. Hristidis
>> > Electrical and Computer Engineering
>> > National Technical University of Athens
>> > e-mail:exrist_at_cc.ece.ntua.gr
>> > URL:http://www.cc.ece.ntua.gr/~exrist
>> >
>> >
>> >
>> >
>>
 

Thomas Kyte
tkyte_at_us.oracle.com
Oracle Government
Herndon VA

--
http://govt.us.oracle.com/    -- downloadable utilities
 
----------------------------------------------------------------------------
Opinions are mine and do not necessarily reflect those of Oracle Corporation
 
Anti-Anti Spam Msg: if you want an answer emailed to you, 
you have to make it easy to get email to you.  Any bounced
email will be treated the same way i treat SPAM-- I delete it.
Received on Wed Nov 18 1998 - 00:00:00 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US