'Oracle UTL_FILE setting wrong permissions
I have NFS share being accessed by two user oracle and tech1. The files created by tech1 user are processed and copied by oracle user.
But the files copied and used by oracle user are with changed ownership, that means the files which were previously owned by tech1 user after copying done by oracle user are changed with owner owner as shown below.
-rw-rw---- tech1 tech1 somefilename.txt
after
UTL_FILE.FCOPY ('MY_DOC',
'somefilename.txt',
'MY_DOC2',
'somefilename.txt-Original_file');
END;
-rw-rw---- oracle tech1 somefilename.txt
It is to be noted that oracle user is part of the group tech1, so it can access the file without ownership. The directories have permissions as follows: source:
drwxrwsr-x tech1 tech1 sourcedirectory
destination :
drwxrwsr-x tech1 tech1 destinationdirectory
How can I stop the oracle user from changing the ownership of the file while copying? The same is the case with UTL_FILE.OPEN command. It is to be noted that I cannot change the umask for oracle user as it will affect other applications in the cluster.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
