5 Replies Latest reply: May 15, 2012 11:21 AM by Neeraj Sehgal RSS

    Deleting objects from MDS

    933720
      Hi ALL,

      I want to know how i can delete files or folders from MDS

      I tried below, its deleting all the files in the directory
      <DeleteMetadata dir="AIAComponents/test" wlserver="fp" />

      If i'm trying this, to delete a specific file
      <DeleteMetadata dir="AIAComponents/test/test.xml" wlserver="fp" />
      i'm getting "Build Failed" error

      My requirement is to delete a single file from the directory if it is having more no. of files. And i also want to know how to delete a directory.

      Can anyone suggest me on this

      Regards,
      Kishore
        • 1. Re: Deleting objects from MDS
          user9285225
          Hi Kishore,

          Use WLST scripts

          The WLST script is located at:

          (UNIX) MIDDLEWARE_HOME/ORACLE_SOA1/common/bin/wlst.sh
          (Windows) MIDDLEWARE_HOME\Oracle_SOA1\common\bin\wlst.cmd

          Once the scripting tool is initialized, Connect to the server

          offline>connect(‘username,’pwd’, ‘hostname:7001’)

          For running deleteMetada function you need a minimum of 3 inputs
          - application - since we are deleting from shared artifacts of soa-infra, the value should be soa-infra
          - server - value should be ‘soa_server1’ or the server u use for SOA other than admin server.
          - docs – the folder path or artifact which you want to delete.

          wls:/GEO_domain/serverConfig> deleteMetadata(application='soa-infra',server='soa
          _server1',docs='/apps/dvm/oracle/dvm/*')

          Executing operation: deleteMetadata.

          Operation "deleteMetadata" completed. Summary of "deleteMetadata" operation is:

          List of documents successfully deleted:
          /apps/dvm/oracle/dvm/GeoXRef.dvm


          Hope this helps
          • 2. Re: Deleting objects from MDS
            933720
            Thanks Eddie for reply.

            I used wslt script and executed this deleteMetadata function

            wls:/soa_domain/serverConfig> deleteMetadata(application='soa-infra',server='soa_server1',docs='/apps/AIAMetaData/AIAComponents/test/*')

            But i'm getting error like:
            Traceback (innermost last):
            File "<console>", line 1, in ?
            NameError: deleteMetadata

            Can u suggest me on this?


            Regards,
            Kishore
            • 3. Re: Deleting objects from MDS
              Neeraj Sehgal
              Hi Kishore,

              Did you run the command from *<MW_HOME>/oracle_common/common/bin* ? Try running the command from this location.

              See if this helps.
              http://neeraj-soa-tips.blogspot.co.uk/2011/06/delete-data-from-mds-single-files.html

              Also paste the entire log here and ensure that your soa-infra application is up.

              Regards,
              Neeraj Sehgal
              • 4. Re: Deleting objects from MDS
                933720
                Hi Neeraj,

                I followed the sane steps as of in the link you mentioned,
                http://neeraj-soa-tips.blogspot.co.uk/2011/06/delete-data-from-mds-single-files.html

                I'm providing the log here where i'm getting the error:

                [aiauser@CRPAS03 bin]$ ./wlst.sh
                CLASSPATH=/FS/aiauser/product/Oracle/Middleware/patch_wls1035/profiles/default/sys_manifest_classpath/weblogic_patch.jar:/FS/aiauser/product/Oracle/Middleware/patch_ocp360/profiles/default/sys_manifest_classpath/weblogic_patch.jar:/usr/java/jdk1.6.0_26/lib/tools.jar:/FS/aiauser/product/Oracle/Middleware/wlserver_10.3/server/lib/weblogic_sp.jar:/FS/aiauser/product/Oracle/Middleware/wlserver_10.3/server/lib/weblogic.jar:/FS/aiauser/product/Oracle/Middleware/modules/features/weblogic.server.modules_10.3.5.0.jar:/FS/aiauser/product/Oracle/Middleware/wlserver_10.3/server/lib/webservices.jar:/FS/aiauser/product/Oracle/Middleware/modules/org.apache.ant_1.7.1/lib/ant-all.jar:/FS/aiauser/product/Oracle/Middleware/modules/net.sf.antcontrib_1.1.0.0_1-0b2/lib/ant-contrib.jar:

                PATH=/FS/aiauser/product/Oracle/Middleware/wlserver_10.3/server/bin:/FS/aiauser/product/Oracle/Middleware/modules/org.apache.ant_1.7.1/bin:/usr/java/jdk1.6.0_26/jre/bin:/usr/java/jdk1.6.0_26/bin:/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:/home/aiauser/bin:/FS/aiauser/product/jdk1.6.0_27/bin

                Your environment has been set.

                CLASSPATH=/FS/aiauser/product/Oracle/Middleware/patch_wls1035/profiles/default/sys_manifest_classpath/weblogic_patch.jar:/FS/aiauser/product/Oracle/Middleware/patch_ocp360/profiles/default/sys_manifest_classpath/weblogic_patch.jar:/usr/java/jdk1.6.0_26/lib/tools.jar:/FS/aiauser/product/Oracle/Middleware/wlserver_10.3/server/lib/weblogic_sp.jar:/FS/aiauser/product/Oracle/Middleware/wlserver_10.3/server/lib/weblogic.jar:/FS/aiauser/product/Oracle/Middleware/modules/features/weblogic.server.modules_10.3.5.0.jar:/FS/aiauser/product/Oracle/Middleware/wlserver_10.3/server/lib/webservices.jar:/FS/aiauser/product/Oracle/Middleware/modules/org.apache.ant_1.7.1/lib/ant-all.jar:/FS/aiauser/product/Oracle/Middleware/modules/net.sf.antcontrib_1.1.0.0_1-0b2/lib/ant-contrib.jar::/FS/aiauser/product/Oracle/Middleware/utils/config/10.3/config-launch.jar::/FS/aiauser/product/Oracle/Middleware/wlserver_10.3/common/derby/lib/derbynet.jar:/FS/aiauser/product/Oracle/Middleware/wlserver_10.3/common/derby/lib/derbyclient.jar:/FS/aiauser/product/Oracle/Middleware/wlserver_10.3/common/derby/lib/derbytools.jar::

                Initializing WebLogic Scripting Tool (WLST) ...

                Welcome to WebLogic Server Administration Scripting Shell

                Type help() for help on available commands

                wls:/offline> connect('weblogic', 'weblogicaia11', '10.180.85.12:9001')
                Connecting to t3://10.180.85.12:9001 with userid weblogic ...
                Successfully connected to Admin Server 'soa_admin' that belongs to domain 'soa_domain'.

                Warning: An insecure protocol was used to connect to the
                server. To ensure on-the-wire security, the SSL port or
                Admin port should be used instead.

                wls:/soa_domain/serverConfig> deleteMetadata(application='soa-infra',server='soa_server1',docs='/apps/AIAMetaData/AIAComponents/test/*')
                Traceback (innermost last):
                File "<console>", line 1, in ?
                NameError: deleteMetadata


                Can you suggest me on this..

                Regards,
                Kishore
                • 5. Re: Deleting objects from MDS
                  Neeraj Sehgal
                  Hi Kishore,

                  From the message it seems that it is something related to name. Please verify the following:
                  1.) When you type deleteMetadata() it gives you the TypeError: deleteMetadata() takes at least 3 arguments (0 given)
                  2.) Try to connect to SOA server instead of Admin server using the connect command and see the result.

                  Regards,
                  Neeraj Sehgal