Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

UTL_FILE.FREMOVE - permissions

xxsawerNov 18 2021

Hi All,
I am trying to remove a file via UTL_FILE.FREMOVE providing database directory and file name. We are runing Oracle Enterprise 12.1.0.2.0 under Suse Enterprise 11.4.
For removing of a file under Linux, only directory permissions should be relevant (file permissions are irelevant).
To test it I create a file under OS user A and remove all the permissions. The folder the file is in has full permissions. Now I switch to another OS user and delete the file via rm. Works fine...
Now I try to remove the same file in the same folder from DB via FREMOVE and get
Error report -
ORA-29283: invalid file operation
ORA-06512: at "SYS.UTL_FILE", line 251
ORA-06512: at "SYS.UTL_FILE", line 1230
ORA-06512: at line 3

Why?

Providing write permissions to the above mentioned file fixes it. I am wondering for what Oracle needs write permisison the the file it is deleting?
Oracle documentation says:
This procedure does not verify privileges before deleting a file. The operating system verifies file and directory permissions.

This post has been answered by Solomon Yakobson on Nov 18 2021
Jump to Answer
Comments
Post Details
Added on Nov 18 2021
13 comments
3,072 views