Say, I have an oracle directory and granted to user 'scott'
CREATE OR REPLACE DIRECTORY dataFolder AS '/data/';
GRANT READ, WRITE ON DIRECTORY dataFolder TO scott;
Then, I have a shell script say ExtractData.sh
which uses UTL_FILE
to convert BLOB
data from database to physical files stored in the above directory dataFolder
.
However, due to security concern in server, this /data/
directory is only given 770
permission, hence causing my script fails to write file into the directory.
But, when I change the permission to 777
, script successfully writes file.
How to solve this by not giving 777
permission?