Wednesday, July 27, 2011

How to Remove Contents from MDS Repository

In 11g we can publish artifacts and commonly used schema, wsdl's in a meta data store to acccess across processes.

Often we realize that sometime we need to clean up and remove unnecessary and unwanted files from the repostiory.

There are two ways you can remove contents from MDS offline mode and online mode. I will explain both the options below

Option 1: Offline Mode


Step 1: Execute wlst.sh
Goto YOUR_MIDDLEWARE_HOME/Oracle_SOA1/common/bin and execute wlst.sh
Step 2: Run Command
At wlst command prompt (wls:/offline>) execute the following

sca_removeSharedData('http://yourhost:yourport', 'directory', 'adminuser', 'adminpassword')

To remove a folder named "common" folder and all it's sub-directories and files.

sca_removeSharedData('http://localhost:8001', 'common', 'weblogic', 'weblogic1')


Option 2: Online Mode


Step 1: Execute wlst.sh
Goto YOUR_MIDDLEWARE_HOME/Oracle_SOA1/common/bin and execute wlst.sh

Step 2: Connect to SOA server
At wlst command prompt (wls:/offline>) execute the following

connect('adminuser', 'adminpassword', 't3://hostname:port')

ex:
connect('weblogic', 'weblogic1', 't3://localhost:8001')

Step 2: Remove Content from MDS

deleteMetadata(application='soa-infra',server='soa_server1',docs='/apps/common')