0

I am facing a strange issue using my Oracle SQL developer as a client for a Oracle 11g database.

I have a plsql procedure that writes some report files using UTL_FILE package. If I run it from SQL developer it fails, with the following error:

CHAIN_LOG_ID="5205", STEP_NAME="STEP2", ORA-29283: invalid file operation
ORA-06512: at "SYS.UTL_FILE", line 536
ORA-29283: invalid file operation
ORA-06512: at "SDG_CDR.MONTHLY_LOCATION_REPORT", line 37

If I run the same procedure directly on sql plus, it works fine and generates the report files. I have created the output directory from sql developer and it looks fine to me as it has been created as sys user.

ROMANIA_engineer
  • 54,432
  • 29
  • 203
  • 199
LogLady
  • 11
  • 1
  • 4
  • 1
    First of all, you shouldn't create any object with sys user. Second, check the directory privileges for the user executing it in SQL Developer. – tilley31 Aug 08 '13 at 23:53
  • The user executing in SQL Developer is the schema owner, I guess. I granted it priviledges to write and read in the directory. This procedure is executed by an oracle job and it works fine the first time the job starts (generating the file), but it fails with that error by the second time. – LogLady Aug 09 '13 at 01:50
  • What is the `UTL_FILE` operation that is executed at `"SDG_CDR.MONTHLY_LOCATION_REPORT", line 37`? – user272735 Aug 09 '13 at 05:20
  • possible duplicate of [UTL\_FILE.FOPEN() procedure not accepting path for directory?](http://stackoverflow.com/questions/2751113/utl-file-fopen-procedure-not-accepting-path-for-directory) – APC Aug 09 '13 at 06:07
  • @tilley31 - SYS is the *only* user who can have directory objects. That's why the privilege is CREATE ANY DIRECTORY. No matter who creates the object it is owned by SYS. – APC Aug 09 '13 at 06:11

0 Answers0