Oracle 9i, utl_file_dir and CREATE DIRECTORY - problematic
Hello,
I need to write a log file to my linux filsystem. I had this going on Oracle 8i but Oracle 9i is proving problematic...I have done the following...
1) Tried the new way
CREATE DIRECTORY utl_file_logs AS '/path/to/logdir'#
GRANT READ ON DIRECTORY TO user;
GRANT WRITE ON DIRECTORY TO user;
Then;
PROCEDURE debug2(p_Debug VARCHAR2) IS
v_File UTL_FILE.FILE_TYPE;
BEGIN
v_File := UTL_FILE.FOPEN('utl_file_logs', 'test.txt', 'A', 2000);
UTL_FILE.PUT_LINE(v_File, p_Debug);
UTL_FILE.FCLOSE(v_File);
END debug2;
Giving...
SQL> exec pkgname.debug2('test');
BEGIN pkgname.debug2('test'); END;
*
ERROR at line 1:
ORA-29280: invalid directory path
ORA-06512: at "SYS.UTL_FILE", line 18
ORA-06512: at "SYS.UTL_FILE", line 424
ORA-06512: at "SCHEMANAME.PKGNAME", line 12
ORA-06512: at line 1
2) Tried the old way
ALTER SYSTEM SET utl_file_dir = '/path/to/logdir' SCOPE=SPFILE
rebooted instance for luck.
Using a slightly difference debug procedure gives me;
SQL> exec ugoLogging.debug('test');
BEGIN pkgname.debug('test'); END;
*
ERROR at line 1:
ORA-29283: invalid file operation
ORA-06512: at "SYS.UTL_FILE", line 18
ORA-06512: at "SYS.UTL_FILE", line 439
ORA-29283: invalid file operation
ORA-06512: at "SCHEMENAME.PKGNAME", line 37
ORA-06512: at line 1
==================
SO getting somewhere with the second. So I figured permissions...
did a CHMOD 777 /path/to/logdir
STILL no luck
Help!?
Re: Oracle 9i, utl_file_dir and CREATE DIRECTORY - problematic
Look for error in your ugoLogging.debug('test') function.
Quote:
Originally posted by adcworks
1)
ORA-29280: invalid directory path
ORA-06512: at "SYS.UTL_FILE", line 18
ORA-06512: at "SYS.UTL_FILE", line 424
ORA-06512: at "SCHEMANAME.PKGNAME", line 12
ORA-06512: at line 1
2) Tried the old way
ALTER SYSTEM SET utl_file_dir = '/path/to/logdir' SCOPE=SPFILE
rebooted instance for luck.
Using a slightly difference debug procedure gives me;
SQL> exec ugoLogging.debug('test');
BEGIN pkgname.debug('test'); END;
*
ERROR at line 1:
ORA-29283: invalid file operation
ORA-06512: at "SYS.UTL_FILE", line 18
ORA-06512: at "SYS.UTL_FILE", line 439
ORA-29283: invalid file operation
ORA-06512: at "SCHEMENAME.PKGNAME", line 37
ORA-06512: at line 1
==================