title: PL/SQL ORA-29280: invalid directory path and ORA-06512: at "SYS.UTL_FILE" in oracle 11g
body: <p>I just want to write table data into a text file using <code>UTL_FILE</code> concept.What I've done is </p>
  
  <p>i) Created a new directory: </p>
  
  <pre><code>  Create directory ddd as 'D:\sql';
  </code></pre>
  
  <p>ii) Granted Read and Write access of that directory to the user HR:</p>
  
  <pre><code> grant read,write on directory ddd to hr;
  </code></pre>
  
  <p>iii) Granted misc UTL_FILE privileges:</p>
  
  <pre><code> grant execute on UTL_FILE to hr;
  </code></pre>
  
  <p>I wrote the program  and got error as follows:</p>
  
  <pre><code>SQL&gt; connect hr/admin
  
  Connected.
  
  SQL&gt; declare      
    2   f  utl_file.file_type;      
    3  i  varchar(100);    
    4  begin    
    5  f:=utl_file.fopen('ddd','utlfile.txt','w',32767);    
    6  for x in(select first_name,salary from employees where rownum&lt;=10)loop    
    7  i:=x.first_name||' '||x.salary;    
    8  utl_file.put_line(f,i);    
    9  utl_file.new_line(f);    
   10  end loop;    
   11  utl_file.fclose(f);    
   12  end;    
   13  /
  </code></pre>
  
  <p><strong>Got output as:</strong></p>
  
  <pre><code>declare    
  *    
  ERROR at line 1:    
  ORA-29280: invalid directory path    
  ORA-06512: at "SYS.UTL_FILE", line 41    
  ORA-06512: at "SYS.UTL_FILE", line 478    
  ORA-06512: at line 5
  </code></pre>
  
  <p>I don't know what am I missing here.... I'm struggling with this issue for around 2 days. Please help me..</p>