Home » SQL & PL/SQL » SQL & PL/SQL » PL/SQL - Unix Modify Permission ((Oracle Database 10g Express Edition Release 10.2.0.1.0, UNIX) )
PL/SQL - Unix Modify Permission [message #392995] Thu, 19 March 2009 23:21 Go to next message
wmgonzalbo
Messages: 98
Registered: November 2008
Member
Hi experts,

Is there a way to modify the permission of the sent files in my directory (My_DIR1) using PL/SQL only, not setting the permission in the OS (UNIX) level?

I need to do this because I get my input files from My_DIR1 (with chmod 777 permission already), then I rename the files that are already processed. I am encountering the error: ORA-29283: invalid file operation, IF i dont set the permission of the input files (through UNIX) to chmod 777 (permit all).

I granted this options to my directory:


GRANT READ, WRITE ON DIRECTORY  My_DIR1 TO MySchema WITH GRANT OPTION;

GRANT READ, WRITE ON DIRECTORY  My_DIR1 TO SYSTEM WITH GRANT OPTION;



After searching, I encountered that some modify their init.ora,
and adds this

UTL_FILE_DIR=/mypath/insidemypath.

But i believe this doesn't give/modify permission in the OS level? I tried it, and still to no avail.

Is there a way to modify, the OS level permissions of my directory using PL/SQL only, and not writing a java or UNIX shell script? Because that may be my next option if there is no work around here.

Also I'm not sure of the initial permissions of my input files when they will be sent to my directory and I doubt they will have the permission of chmod 777, permit all.

Thanks for the time.

Regards,
Wilbert
Re: PL/SQL - Unix Modify Permission [message #392996 is a reply to message #392995] Thu, 19 March 2009 23:26 Go to previous messageGo to next message
BlackSwan
Messages: 25050
Registered: January 2009
Location: SoCal
Senior Member
>Is there a way to modify, the OS level permissions of my directory using PL/SQL only,
No. Oracle does not really know or care which OS or file permissions.
The PL/SQL operation will either succeed or fail.
What ever script that delivers the file should changes the file ownership.
Re: PL/SQL - Unix Modify Permission [message #393011 is a reply to message #392995] Fri, 20 March 2009 00:31 Go to previous messageGo to next message
Michel Cadot
Messages: 64152
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
You need to understand what are permissions at OS level.
If a program can change the permission as it wants because it is not able to read/write them this means that permissions are useless.
The permissions are there to restrict accesses. The correct way is to modify the permissions at OS level in order to allow the program to use the file as it needs to use it.

Regards
Michel
Re: PL/SQL - Unix Modify Permission [message #393039 is a reply to message #392995] Fri, 20 March 2009 02:13 Go to previous message
wmgonzalbo
Messages: 98
Registered: November 2008
Member
Alright. Thanks BlackSwan and Michel Cadot! Smile
Previous Topic: Tranposed output
Next Topic: Database Platform details
Goto Forum:
  


Current Time: Sat Dec 10 04:56:28 CST 2016

Total time taken to generate the page: 0.15608 seconds