Home » SQL & PL/SQL » SQL & PL/SQL » ORA-29283: invalid file operation
ORA-29283: invalid file operation [message #175944] Tue, 06 June 2006 03:20 Go to next message
rajavu1
Messages: 1574
Registered: May 2005
Location: Bangalore , India
Senior Member

Hi ,

I am getting an error ORA-29283: invalid file operation
when i tried as follows ....

SQL> show user
USER is "SYSTEM"
SQL> SELECT *  FROM DBA_DIRECTORIES
  2  WHERE DIRECTORY_NAME='EXT_DIR';

OWNER                          DIRECTORY_NAME
------------------------------ ------------------------------
DIRECTORY_PATH
-------------------------------------------------------------------------------

SYS                            EXT_DIR
/oracle/ora9204/orahome/locality/ext_dir


SQL> GRANT READ,WRITE ON DIRECTORY EXT_DIR TO SCOTT;

Grant succeeded.

SQL> connect
Enter user-name: scott
Enter password:
Connected.
SQL> show user
USER is "SCOTT"
SQL> CREATE OR REPLACE PROCEDURE utl_file_test_write (
  2    path       IN VARCHAR2,
  3    filename   IN VARCHAR2,
  4    firstline  IN VARCHAR2,
  5    secondline IN VARCHAR2)
  6  IS
  7      output_file  UTL_FILE.FILE_TYPE;
  8  BEGIN
  9      output_file := UTL_FILE.FOPEN (path,filename, 'W');
 10
 11      UTL_FILE.PUT_LINE (output_file, firstline);
 12      UTL_FILE.PUT_LINE (output_file, secondline);
 13      UTL_FILE.FCLOSE(output_file);
 14
 15  --   EXCEPTION
 16  --    WHEN OTHERS THEN NULL;
 17  END;
 18  /

Procedure created.

SQL> DECLARE
  2    PATH VARCHAR2(200);
  3    FILENAME VARCHAR2(200);
  4    FIRSTLINE VARCHAR2(200);
  5    SECONDLINE VARCHAR2(200);
  6
  7  BEGIN
  8    PATH := 'EXT_DIR';
  9    FILENAME := 'adcd.txt';
 10    FIRSTLINE := 'abcdefg';
 11    SECONDLINE := 'hijklmn';
 12
 13    SCOTT.UTL_FILE_TEST_WRITE ( PATH, FILENAME, FIRSTLINE, SECONDLINE );
 14    COMMIT;
 15  END;
 16  /
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 "SCOTT.UTL_FILE_TEST_WRITE", line 9
ORA-06512: at line 13


SQL>


can anybody help me out ...

Thumbs Up
Rajuvan.
Re: ORA-29283: invalid file operation [message #175963 is a reply to message #175944] Tue, 06 June 2006 03:46 Go to previous messageGo to next message
Frank Naude
Messages: 4593
Registered: April 1998
Senior Member
29283, 00000, "invalid file operation"
// *Cause:  An attempt was made to read from a file or directory that does
//          not exist, or file or directory access was denied by the
//          operating system.
// *Action: Verify file and directory access privileges on the file system,
//          and if reading, verify that the file exists.


Please post output from:
$ ls -ld /oracle/ora9204/orahome/locality/ext_dir
Re: ORA-29283: invalid file operation [message #175964 is a reply to message #175944] Tue, 06 June 2006 03:51 Go to previous messageGo to next message
rajavu1
Messages: 1574
Registered: May 2005
Location: Bangalore , India
Senior Member

Thanks Frank for your reply,

Sorry,

I dont have access to the server ..

Rajuvan.
Re: ORA-29283: invalid file operation [message #175966 is a reply to message #175944] Tue, 06 June 2006 04:11 Go to previous messageGo to next message
himang
Messages: 282
Registered: March 2005
Location: Bangalore
Senior Member

Nothing wrong with the code. It is perfectly fine. Just verify if the directory path is correct and you have correct permissions.

I suppose that is the only way to go.

Regards
Himanshu
Re: ORA-29283: invalid file operation [message #340939 is a reply to message #175966] Fri, 15 August 2008 01:46 Go to previous messageGo to next message
catalyst
Messages: 3
Registered: August 2008
Location: Pakistan
Junior Member
Hi Folks,

In case of windows OS (like XP), the error is not removed even if you change the rights on folder. This happens because sometimes when we change the rights of folders, the change do not propogate to the inner folders & specially files (those you want to read).

So check the rights on those files as well, if needed correct them and you will not get this error then.

Regards
Re: ORA-29283: invalid file operation [message #340940 is a reply to message #340939] Fri, 15 August 2008 01:53 Go to previous message
Frank
Messages: 7901
Registered: March 2000
Senior Member
Let the zombies sleep please.
Especially if your reply has little to do with the problem.
Previous Topic: Oracle SubQuery
Next Topic: trigger errors out
Goto Forum:
  


Current Time: Sun Feb 16 00:37:24 CST 2025