*
The moose likes JDBC and the fly likes file permission for the reports generated by Oracle Procedure Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "file permission for the reports generated by Oracle Procedure" Watch "file permission for the reports generated by Oracle Procedure" New topic
Author

file permission for the reports generated by Oracle Procedure

jaya kemmannu
Ranch Hand

Joined: Sep 23, 2011
Posts: 83

Hi,

I have oracle procedure which genearte reports on daily basis. The genearted files have permission in the below format :

-rw-r--r-- 1 oracle oinstall 662 Dec 2 23:04 mpg-mediation-lrn-data-02-12-2012.txt
-rw-r--r-- 1 oracle oinstall 7128 Dec 3 13:04 mpg-mediation-lrn-data-03-12-2012-14.txt.

I want to give 777 permission for all the user when the file is getting generated, how can i achieve this in my procedure.

Regards,
Jaya


chris webster
Bartender

Joined: Mar 01, 2009
Posts: 1621
    
  13

Giving "777" permissions on anything is almost always a bad idea.

In any case, it depends how the stored procedure is creating the files.

For example, if they are being written to an Oracle Directory from PL/SQL, then the permissions of the Oracle DB user will determine their read/write access to the Oracle directory from within Oracle, but this will also depend on the access permissions of the relevant Oracle Unix user for the directory in the file system (because files are actually read/written via an Oracle Unix process).

If your files are being created via Java, then you need to look at how Java modifies file permissions at operating system level.


No more Blub for me, thank you, Vicar.
jaya kemmannu
Ranch Hand

Joined: Sep 23, 2011
Posts: 83

Stored proc writes the file into Oracle directory only. With SYSDBA user login i have created :

Create or replace directory FILE_DIR as <path where Reports are to be created>;

Grant read, write on directory MED_DIR to db_user.

 
It is sorta covered in the JavaRanch Style Guide.
 
subject: file permission for the reports generated by Oracle Procedure
 
Similar Threads
log4j generated file permission
unix/ias/java help
file permissions
Using setPermission org.apache.commons.net.ftp.FTPFile
rm: cannot remove : Permission denied