Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.tools -> Re: UTL_FILE.FOPEN and Unix Permissions
Christopher Burke wrote:
>
> I have a directory /var/logs/bob
>
> /var/logs drwxr-x--- bob admin
> /var/logs/bob drwxrwx--- bob admin
>
> I have /var/logs/bob in my INIT.ORA file.
>
> I have made oracle a member of the admin group.
>
> I write a log file 'test.log' into /var/logs/bob successfully when I am
> logged into both Unix AND Oracle as bob.
>
> It creates a file like
>
> /var/logs/bob/test.log -rw-r--r-- oracle oinstall
>
> This means that a process owned by oracle has created the file 'test.log'.
>
> The problem is that I cannot get other users to write to this log file... I
> don't want to put them all in the admin group - I just want to log their
> calls to several stored procedures.
>
> Any help appreciated.
This may not help in your case, but there are two ways that I get around this problem. The first solution is to "pre-create" an empty file with the correct name in the specified directory and make sure that it has the required permissions. Then instead of opening the file for "W" I open it with "A" and then write records to it.
The second solution is to send output to dbms_pipe instead of utl_file and then have a separate listener process do the file i/o. It takes more programming but in some cases it makes for a more flexible approach. Received on Wed Jan 10 2001 - 07:18:11 CST