Monday 12 September 2016

Configure SOA 12c Compact domain for DB MDS

I have a habit of creating virtual box VM myself for oracle product rather downloading pre-build VM from OTN.  Oracle SOA suits 12.2.1 VM available to download in OTN and ships with expanded domain having admin and soa managed server. Since running both admin server and managed server in development laptop is a bit overhead, I have ended up creating a compact domain for development use. During the development I noted compact domain only support for file based MDS and OWSM. 

Following steps concentrate on compact domain and re-configure it to use DB MDS, so that DB-based repository is used instead of file based one. By doing this, it should be possible to edit rules and DVMs during run-time using composer.

Approach:
  1. Check your database already contains MSD schema (<prefix>_mds). If not create new MDS schema using RCU.
  2. Start WLST session.
    • $> cd <fmw_home>/soa/common/bin
    • ./wlst.sh
    • connect('weblogic','welcome1','t3://localhost:7001')
  3. Export current content of the file based MDS
    • exportMetadata(application='soa-infra', server='AdminServer', toLocation='/tmp/mdsexport', docs='/**')
  4. Shutdown soa-infra via weblogic console
    • Deployments -> Control Tab ->Check soa_infra -> Stop -> Force shutdown
  5. De-register file based MDS
    • Log into em console
    • Click Weblogic Domain in right hand corner -> Other Services ->Metadata Repositories
    • Select mds-soa under “File-Based Repositories” and click on De-register
  6. Register a new DB-based Repository
    • Delete existing mds-soa datasource before from WLS Console > Services -> Data Sources -> Check mds-soa -> Delete
    • Log into em console
    • Click Weblogic Domain in right hand corner -> Other Services ->Metadata Repositories
    • Click Register under 'Database-Based Repositories'
    • Enter Database connection information and click 'Query'
    • Select Query return row 'MDS' and enter repository name as 'mds-soa' and schema password for <prefix>_mds and then click 'Ok'
    • Click 'mds-soa' repository and check 'soa-infra' partition visible under 'Repository Partition'
  7. Use WLST to import exported metadata into the new MDS-Partition
    • importMetadata( application='soa-infra', server='AdminServer', fromLocation='/tmp/mdsexport', docs='/**')
  8. Restart AdminServer and double check 'soa-infra' application up and running using weblogic console.
  9. Verify SOA Composer for having “Create Session” Button
  10. Create Jdeveloper DB MDS connection and verify DB MDS artifacts visible in Jdeveloper.
  11. If above verification successful, Well-done, you are ready to use DB based MDS for soa-mds