4 Replies Latest reply: Sep 30, 2013 3:10 AM by BluShadow RSS

    Windows Commands from PLSQL

    EV259

      Hi All,

       

      ORACLE-BASE - Oracle Shell Commands From PL/SQL

       

      I have gone through the above article and tried to move/copy a file which is exists on windows 2008 server installed with Oracle 11.2.0.2. I am succeded with the move/copy the file with in the server's different folder.

       

      If I run the below code, the file 'test1.jpg' was copied to D:\TEST_BLOB.

      BEGIN

        host_command (p_command => 'copy D:\BLOB_EXTRACT\test1.jpg D:\TEST_BLOB');

        dbms_output.put_line('Done');

      END;

      My doubt here is, I am not able to move/copy a file to a network drive. Can we able to do this by running the scripts mentioned in the above article.

       

      Here X: is network drive of different server. I am running the code without any errors but, the file is not getting copied.

      BEGIN

        host_command (p_command => 'copy D:\BLOB_EXTRACT\test1.jpg X:\test');

        dbms_output.put_line('Done');

      END;

      Please guide me.

       

      Thanks.

        • 1. Re: Windows Commands from PLSQL
          Etbin

          Might have something to do with ACL Oracle Clusterware Resource Reference

          I'm just an underprivileged developer so it's only a guess.

           

          Regards

           

          Etbin

          • 2. Re: Windows Commands from PLSQL
            Solomon Yakobson

            By default windows services are started under local system account which obviously has no permissions on mapped drives. You need to create a local user with same name as domain user with proper permissions on mapped drive. Then modify and start oracle services as that user.

             

            SY.

            • 3. Re: Windows Commands from PLSQL
              EV259

              Thanks SY. But I am not complete understood on this.

               

              I have a user 'DEMO.DEV', which i used to login to the DB server(Win 2008) and the Apps Server( Win 2003). I have the database user as 'DEMOTST'.

               

              Kindly clarify me on the above solution.

               

              Thanks in advance.

              • 4. Re: Windows Commands from PLSQL
                BluShadow

                It's not who you log into oracle as, it's the user on the server that the Oracle services are running as.

                 

                When the server it booted up, apart from the operating system itself, various programs and services are started by the server.  Some of those will start as the "root" or "Administrator" user, and some will be installed and running as some other user(s).  The Oracle database instance is one such service and will have been installed on the server so that it starts up under the guise of a particular user on that server. (We're talking server users, not database users).  Who that user is, depends on who installed the database instance and what options they chose when installing.  They could have picked the default options or they could have customized it to be some other user.  As we cannot see your server we cannot tell you exactly.  You'll have to speak to the person/DBA who installed it, or who can check for you.