Friday 19 April 2013

MDS Import/Export/Delete using wlst.


MDS Import/Export/Delete:


IMPORT METADATA TO MDS :
STEP 1:
SOURCE LOCATION :
 [fmwadmin@abcapp018 XYZApplicationObjectLibrary]$ pwd
/u01/Oracle/mds/apps/XYZMetaData/XYZComponents/XYZApplicationObjectLibrary
[fmwadmin@abcapp018 XYZApplicationObjectLibrary]$ ls
deploySOA.xml

·         The above “deploySOA.xml” file has to be uploaded to mds.
·         So I have created the hierarchy as I want it to be .
·         In My case it is “apps/XYZMetaData/XYZComponents/XYZApplicationObjectLibrary” under the source “/u01/Oracle/mds”
·         Make sure you give all permission to the above hierarchy folders under the source “/u01/Oracle/mds”

STESTE
STEP 2:

[fmwadmin@abcapp018 bin]$ pwd
/u01/Oracle/Middleware/wlserver_10.3/server/bin
[fmwadmin@abcapp018 bin]$ . ./setWLSEnv.sh
STEP 3:
/u01/Oracle/Middleware/oracle_common/common/bin
[fmwadmin@abcapp018 bin]$ ./wlst.sh
STEP 4:
wls:/offline>connect(‘weblogic’,’password’,’t3://hostname:adminport’)
STEP 5:
wls:/XYZ_domain/serverConfig> importMetadata(application='soa-infra',server='XYZ_soa_server1',fromLocation='/u01/Oracle/mds',docs='/apps/XYZMetaData/XYZComponents/XYZApplicationObjectLibrary/**')
Command:
wls:/XYZ_domain/serverConfig> importMetadata(application='soa-infra',server='XYZ_soa_server1',fromLocation='/u01/Oracle/mds',docs='/apps/XYZMetaData/XYZComponents/XYZApplicationObjectLibrary/**')
Executing operation: importMetadata.
Operation "importMetadata" completed. Summary of "importMetadata" operation is:
List of documents successfully transferred:
/apps/XYZMetaData/XYZComponents/XYZApplicationObjectLibrary/deploySOA.xml
1 documents successfully transferred.
wls:/XYZ_domain/serverConfig>

Verification: Check the same from Jdeveloper

______________________________________________________________________________________
EXPORT METADATA FROM MDS:
STEP 1:Target location below. Make sure it is having enof space and permissions.
[fmwadmin@abcapp018 XYZApplicationObjectLibrary]$ pwd
/u01/Oracle/mds/
REPEAT STEP 2,3,4 of “IMPORT METADATA TO MDS SECTION”:
STEP 5:
exportMetadata(application='soa-infra', server='XYZ_soa_server1',toLocation='/u01/Oracle/mds', docs='/apps/XYZMetaData/XYZComponents/XYZApplicationObjectLibrary/deploySOA.xml')

________________________________________________________________________________________

DELETE METADATA FROM MDS:
REPEAT STEP 2 to STEP 4 in the IMPORT SECTION ABOVE:
Then execute below command.
wls:/XYZ_domain/serverConfig> deleteMetadata(application='soa-infra',server='XYZ_soa_server1',docs='/apps/XYZMetaData/XYZComponents/XYZApplicationObjectLibrary/deploySOA.xml')
Executing operation: deleteMetadata.
Operation "deleteMetadata" completed. Summary of "deleteMetadata" operation is:
List of documents successfully deleted:
/apps/XYZMetaData/XYZComponents/XYZApplicationObjectLibrary/deploySOA.xml
1 documents successfully deleted.
wls:/XYZ_domain/serverConfig>