5 Replies Latest reply: May 5, 2012 2:08 AM by HuaMin Chen RSS

    ora-22286 message

    Munish
      Hi,
      I am running 8.1.7 db.
      I created a directory called IMAGES.
      I created synonym for it .

      I have a stored proc which when called post the images in the IMAGES directory to the db.

      I am getting the following message and I am not sure what privilege am I missing. I believe I gave the user all the priv except any GLOBAL priv.

      Here is the error message I get.

      ORA-22286: INSUFFICIENT PRIVILEGES ON FILE OR DIRECTORY TO PERFORM GETLENGTH OPERATION
      ORA-06512:AT "SYS.DBMS_LOB", LINE 578
      ORA-06512: AT "EDUMET.POS

      Thanks
      Munish
        • 1. Re: ora-22286 message
          sb92075
          Munish wrote:
          Hi,
          I am running 8.1.7 db.
          I created a directory called IMAGES.
          I created synonym for it .

          I have a stored proc which when called post the images in the IMAGES directory to the db.

          I am getting the following message and I am not sure what privilege am I missing. I believe I gave the user all the priv except any GLOBAL priv.

          Here is the error message I get.

          ORA-22286: INSUFFICIENT PRIVILEGES ON FILE OR DIRECTORY TO PERFORM GETLENGTH OPERATION
          ORA-06512:AT "SYS.DBMS_LOB", LINE 578
          ORA-06512: AT "EDUMET.POS

          Thanks
          Munish
          prvileges acquired via ROLE do *NOT* apply within named PL/SQL procedures
          • 2. Re: ora-22286 message
            Munish
            so how would I solve this issue then?
            • 3. Re: ora-22286 message
              HuaMin Chen
              create directory images;
              grant read, write on directory images to the_user;

              Edited by: HuaMin on May 4, 2012 11:25 PM
              • 4. Re: ora-22286 message
                Munish
                Thanks,
                I read works fine but when I issue write priveilege I get the following..
                I am logged on as sys when giving these grants.

                SQL> GRANT WRITE ON DIRECTORY IMAGES TO MHEREDIA;
                GRANT WRITE ON DIRECTORY IMAGES TO MHEREDIA
                *
                ERROR at line 1:
                ORA-22928: invalid privilege on directories
                • 5. Re: ora-22286 message
                  HuaMin Chen
                  Did you try "conn sys as sysdba" as the syntax should be right?

                       GRANT WRITE ON DIRECTORY <directory_name> TO <schema_name>

                  Edited by: HuaMin on May 5, 2012 3:07 PM