Session Accessing File On Disk Fail with OS File Permission Errors (Doc ID 392647.1)

Last updated on FEBRUARY 15, 2017

Applies to:

Oracle Database - Enterprise Edition - Version 8.1.7.4 to 11.2.0.2 [Release 8.1.7 to 11.2]
Information in this document applies to any platform.
***Checked for relevance on 15-Feb-2017***

Symptoms

This document applies to situation when a session supposed to access a disk file (LOB, flat file accessed with UTL_FILE, external table and so on) errors out with ORA-22288, ORA-29283, KUP-04063 and OS file permission errors while the OS oracle user can access the same files without problems, being able to create new files and write or read the existing files.
It can occur that bequeath sessions can access the files while the listener sessions can or even the opposite, when the listener created sessions can access the files while bequeath sessions can't.

To investigate the situation, the following steps should be done:
#1. start a new session with sqlplus.
#2. in the new created session, check what is the corresponding OS process ID for the shadow process:

select spid from v$process where addr =
  (select paddr from v$session where sid =
    (select distinct sid from v$mystat)
  );


#3. create a new shell and enable OS tracing for that session:

truss -aef -o sqlplus.trc -p <spid from query above>


(for AIX and Solaris)

strace -f -o sqlplus.trc -p <spid from query above>


(for Linux)

tusc -aef -o sqlplus.trc -p <spid from query above>

(for HP-UX)
#4. in the sqlplus session run the failing operation.
#5. check the resulting trace file with a file editor and look for the directory under which the file is created. It should indicate an OS access error: EACCES

For processes created by the listener, for which the files are generated when the process starts (eg audit files), take the same trace files for the listener process.
1. obtain the listener pid:

ps -ef | gren tns


2. set tracing in the same way as above, eg:

truss -aefo listener.trc -p <pid from above>

Cause

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms