Problem :
The permissions on directory are :
drwxrwxr-x 2 oraext oraext 1392 2008-10-29 16:32 files
oraext is the secondary group of oracle user.
1. When the anonymous block is run as SYS user it runs succesfully.
create or replace directory dir_temp as '/home/oraext/files';
declare
f utl_file.file_type;
begin
f := utl_file.fopen('DIR_TEMP', 'something.txt2', 'w');
utl_file.put_line(f, 'line one: some text');
utl_file.put_line(f, 'line two: more text');
utl_file.fclose(f);
end;/
2. When logged in to OS as oracle user and run the following command the file gets created .
However
When the anonymous block is run as an other schema, the following error is thrown :
ORA-29283: invalid file operation
ORA-06512: at "SYS.UTL_FILE", line 475
ORA-29283: invalid file operation
ORA-06512: at line 4
READ and WRITE on the directory has been granted to the other schema.
Solution :
Restart the listener. The issue got resolved.
QUESTION========
What could be the reason for getting ora-29283 error , if though the oracle user can create a file using touch command on the OS ?
ANSWER======
Once you have done any changes to the folders accessed by utl_file directoiries you should always restart the listener process. Restarting the listener will inherit the recently changes permission and hence enabling oracle user to write a file from database using utl_file package succesfully.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment