utl_file issue? [message #426097] |
Wed, 14 October 2009 01:56  |
mm_kanish05
Messages: 493 Registered: January 2007 Location: Chennai
|
Senior Member |

|
|
Hi,
I want create a file at runtime using utl_file.
First i just create the alias for the server directory using the following command
Select * from all_directories;
OWNER DIRECTORY_NAME DIRECTORY_PATH
SYS AUTO_MAIL home/oracle9i/backups
and i had give the permission to access the directory using
grand read,write on directory to public
further, i run the following coding but i am getting the error too.
declare
f utl_file.file_type;
begin
f := utl_file.fopen('AUTO_MAIL', 'something.txt', 'w');
utl_file.put_line(f, 'line one: some text');
utl_file.put_line(f, 'line two: more text');
utl_file.fclose(f);
end;
error
declare
*
ERROR at line 1:
ORA-29283: invalid file operation
ORA-06512: at "SYS.UTL_FILE", line 449
ORA-29283: invalid file operation
ORA-06512: at line 4
please help how to solve this
kanish
|
|
|
Re: utl_file issue? [message #426102 is a reply to message #426097] |
Wed, 14 October 2009 02:03   |
pablolee
Messages: 2882 Registered: May 2007 Location: Scotland
|
Senior Member |
|
|
Where to start...
Quote:First i just create the alias for the server directory using the following command
The command that follows that quote would not create an alias for a directory.
Quote:
and i had give the permission to access the directory using Nope, code that followed that quote is syntactically invalid.
Did you actually create a directory on the Oracle server's OS? Does Oracle have permission to write to that location?
How about you go through the process and show us a cut and paste from SQL*Plus...
|
|
|
|
|
|
Re: utl_file issue? [message #426109 is a reply to message #426108] |
Wed, 14 October 2009 02:28   |
flyboy
Messages: 1903 Registered: November 2006
|
Senior Member |
|
|
mm_kanish05 wrote on Wed, 14 October 2009 08:56Select * from all_directories;
OWNER DIRECTORY_NAME DIRECTORY_PATH
SYS AUTO_MAIL home/oracle9i/backups
mm_kanish05 wrote on Wed, 14 October 2009 09:13Hi
Sorry typograhicall erron on grant command
As you said i have direcoty on the server and already available ('/home/oracle9i/backups')
Another typo or really missing full path start (/) in the directory definition?
mm_kanish05 wrote on Wed, 14 October 2009 09:13and it is having read and write access at all level (owner,group,others).
You may be right or wrong, it is hard to say without knowing how you got it. It would be good to show how you came to this conclusion, e.g. show the result of ls -l /home/oracle9i
ls -al /home/oracle9i/backups
|
|
|
|
|
|
|
|