On Unix type systems, if you are using UTL_FILE,
then the database daemons create, write or read the file
and they will do so as the owner of the daemon processes.
As long as you rely on UTL_FILE, you will not have a choice
as to the owner of the files created by UTL_FILE.
What you can to is if you own the directory it writes to,
and the O/S and filesystem type permit ACLs,
then you can set "default" ACLs on the directory.
The purpose of "default" ACLs on a directory is that
they are automatically applied to any file or subdirectory
created within that directory.
Make sure the default ACL includes a "default:user:???:rwx" line
for the owner of the directory.
I don't know about HP UX, but on Solaris the ACL commands are
getfacl and setfacl.
Alternatively, stop using UTL_FILE,
and use native file utilities available to programming languages.
Use Pro*C/C++, Pro*COBOL, OCI or OCCI Programming language extensions,
or Perl's DBI & DBD::Oracle packages, to create programs to connect to
the database and to create the files.
Then the files would not be owned by database daemon owner.
-----Original Message-----
From: Dustin Hayden
[mailto:oracledba-ezmlmshield-x6034405.[Email address protected]
Sent: Wednesday, May 30, 2007 8:58 AM
To: LazyDBA Discussion
Subject: file permissions
I have a function that will unload data to a flat file.
I created this function under my user and also created a directory using
the same userid in oracle.
However when the file is created it is owned by oracle.
Is there anyway to set this up so the file will be owned by the correct
userid?
This is on HP UX using oracle 9.2
TIA
Dustin
---------------------------------------------------------------------
TO REPLY TO EVERYBODY , PLEASE CLICK REPLY-ALL, NOT JUST REPLY To post a
dba job: http://jobs.lazydba.com To Subscribe : http://www.LazyDBA.com
To unsubscribe: http://www.lazydba.com/unsubscribe.html
Oracle LazyDBA home page