aspose file tools*
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 Spring in Action this week in the Spring 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: 85

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: 1774
    
  14

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: 85

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.

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: file permission for the reports generated by Oracle Procedure