Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

file permission for the reports generated by Oracle Procedure

 
jaya kemmannu
Ranch Hand
Posts: 89
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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
Posts: 2407
32
Linux Oracle Postgres Database Python Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
jaya kemmannu
Ranch Hand
Posts: 89
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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.

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic