title: Open a remote file using utl_file.fopen on Windows
body: <p>I have to access a remote file in a different computer using <code>utl_file</code>.</p>
  
  <p>This is what I did:</p>
  
  <ol>
  <li><p>create a user with Adminstrator+Users+ora_db profile in the remote PC, the same user is created with the same role in my PC.</p></li>
  <li><p>Run the Oracle Services using this administrator account</p></li>
  <li><p>Map the remote directory under Windows </p></li>
  <li><p>use the following command to configure and accesss the file:  </p></li>
  </ol>
  
  <p></p>
  
  <pre><code>create or replace directory REMOTE_LOG as '\\remote_shared_dir\log';
  
  declare
      f   UTL_FILE.FILE_TYPE;
      line    VARCHAR2(32767) ;
  
  begin
  
      BEGIN
        f := UTL_FILE.FOPEN('REMOTE_LOG','toto.txt','R',32764);
      EXCEPTION WHEN OTHERS THEN
        dbms_output.put_line('err '||sqlerrm);
      END;
  
      UTL_FILE.GET_LINE( f,  line );                
      UTL_FILE.FCLOSE( f ) ;                
  end;
  </code></pre>
  
  <p>But it failed with:</p>
  
  <pre><code>[Error] Execution (7: 3): ORA-29282: invalid file ID
  ORA-06512: at "SYS.UTL_FILE", line 735
  ORA-06512: at line 13
  </code></pre>
  
  <p>When I remove the exception handler I instead see:</p>
  
  <pre><code>[Error] Execution (7: 3): ORA-29283: invalid file operation
  ORA-06512: at "SYS.UTL_FILE", line 536
  ORA-29283: invalid file operation
  ORA-06512: at line 8
  </code></pre>
  
  <p>What am I doing wrong?</p>