Wednesday, 7 December 2011

deleting files form mds

Delete Data from MDS - Single Files

In case an artefact is wrongly published into MDS, it can be deleted from the MDS using 2 ways.
  1. Deleting the entire folder
  2. Deleting the Selective Files
This post details about the latter.
A file can be deleted from the MDS using Weblogic Scripting Tool. However, in upgraded versions of AIA (11g PS3 onwards), this is available  through UpdateMetaDataDP.xml also, very much the same way as we update the artefacts in MDS. To delete a file from MDS follow the following steps.

1. Run WLST command from <MW_HOME>/oracle_common/bin. Note there is same command available in Weblogic Server home directory too but MDS related commands can be accessed through residing in oracle_common_home only 
    $ cd $MW_HOME/oracle_common/common/bin

2. Type the connect command to connect to soa_server1 or WLS_SOA1 depending on where your soa-infra is running
   $ connect('weblogic', 'welcome1', 't3://localhost:8001')

3. Once it is connected, delete The undesired file by typing the following command (Note the path starting from /apps)
  $ deleteMetadata(application='soa-infra',server='soa_server1',docs='/apps/AIAMetaData/AIAComponents/ApplicationConnectorServiceLibrary/Generic.wsdl')

You can use asterisk(*) to specify more than one files e.g. to delete all files with names starting with Gen use 
You may get the following exception
MDS-91002: MDS Application runtime MBean for "soa-infra" is not available. "deleteMetadata" operation failure.
Verify that your soa-infra is up and running and is on the same server to which you are connected through WLST.

Happy Learning...

No comments:

Post a Comment