title: Oracle concurrent program cannot write to directory
body: <p>We have an Oracle EBS <a href="http://docs.oracle.com/cd/E18727_01/doc.121/e12897/T302934T458253.htm" rel="nofollow">concurrent program</a>, ran as applmgr, that needs to load data using SQL*Loader, and move the input data to an archive location:</p>
  
  <pre><code>sqlldr $w_login \
     control=$w_directory/$w_ctrl \
     data=$w_directory/$w_data \
     log=$w_directory/log/$w_data.log
  
  [[ -f $w_directory/log/$w_data.log ]] &amp;&amp; \
     mv $w_directory/$w_data $w_directory/archive/$w_data.archive
  </code></pre>
  
  <p>However, it fails in the <code>mv</code> part:</p>
  
  <pre><code>34 Rows successfully loaded.
  0 Rows not loaded due to data errors.
  0 Rows not loaded because all WHEN clauses were failed.
  0 Rows not loaded because all fields were null.
  
  mv: cannot move `/w_directory/w_data.dat' to `/w_directory/archive/w_data.dat.archive': Permission denied
  </code></pre>
  
  <p>The <code>applmgr</code> user has write permissions on the directories and file:</p>
  
  <pre><code>drwxrwxr-x 14 otheruser othergroup 4096 Apr 16  2012 /w_directory
  drwxrwxr-x 14 otheruser othergroup 4096 Apr 16  2012 /w_directory/log
  drwxrwxr-x 14 otheruser othergroup 4096 Apr 16  2012 /w_directory/archive
  -rwxrwxr-x 14 otheruser othergroup 4096 Apr 16  2012 /w_directory/w_data.dat
  
  $ id applmgr
  uid=1003(applmgr) gid=1000(dba) groups=1000(dba),1003(othergroup)
  </code></pre>
  
  <p>We can run the above program manually, through the command-line as <code>applmgr</code>, without any issues. But it fails with the above error when ran as a concurrent program. We have already bounced the server as well. </p>
  
  <p>The server is on RHEL 6.4. Oracle EBS is R12.1.3.</p>