In an MDS repository, each application (Oracle SOA Suite, Oracle Web Services Manager, and so on) is deployed to its own partition so that they can be logically separated. Not to be confused with partitions, as described in Chapter 4, Managing Services, a metadata repository partition is an independent logical directory within a physical MDS repository that is used to manage the metadata of these different Oracle Fusion Middleware components and applications.
When Oracle SOA Suite 12c is installed, a default repository called mds-soa with a default partition called soa-infra is already created, as shown in the following screenshot. So, as long as the product is installed and satisfies your needs, you may never need to create additional partitions.
However, partition management is more than simply creating a new, empty partition for fresh use. You can also clone, delete, import, and export metadata from a partition. It is possible to leverage either the Fusion Middleware Control console or WLST for all partition management activities. To view the existing metadata repository partitions, simply log in to Fusion Middleware Control, navigate to Metadata Repositories, and then click on one of the repositories or execute the listPartitions MBean operation.
Partitions in a metadata repository can be created by accessing the MDS domain runtime MBean object and invoking the createMetadataPartition
operation from Oracle Enterprise Manager Fusion Middleware Control. Follow the sequence of steps highlighted here in order to browse to MDSDomainRuntime MBean and then invoke specific operations that it exposes:
soa_domain
).Alternatively, you can also create a new partition using the createMetadataPartition
command from the WLST command line. It is important to note that a partition name must be unique within a repository. The following script creates a partition named soa-custom
in the mds-soa
repository:
createMetadataPartition(repository='mds-soa', partition='soa-custom')
Yet another way to create partitions is by invoking the createPartiton
target in the ant-sca-mgmt.xml
Ant script available in the $MW_HOME/Oracle_SOA1/bin
directory of your SOA Suite 12c installation:
ant -f $MW_HOME/Oracle_SOA1/bin/ant-sca-mgmt.xml createPartition -Dhost=<soahost> -Dport=<soaport> -Duser=<username> -Dpassword=<password> -Dpartition=<partition_name>
The same Ant file can also be executed with other targets that take care of various partition management tasks such as deletePartiton
, startCompositesInPartition
, stopCompositesInPartition
, activateCompositesInPartition
, and retireCompositesInPartition
. These targets can be executed with the same set of arguments used in the previous script.
Another efficient way to create a new partition is to clone an existing partition from a source repository to a different repository. Cloning a partition is advantageous, as it preserves the metadata version history, including all customizations made to the deployed composites. However, cloning a partition is permitted only if the source and target repositories are both based on a database with the same type and version. Here again, MDSDomainRuntime MBean contains an operation to clone a partition. The cloneMetadataPartition
operation can be invoked by passing a list of input parameters that specify fromRepository
, fromPartition
, toRepository
, and toPartition
. The arguments required for the function are self-explanatory and should be replaced with actual values specific to your environment. Have a look at the following steps that outline the details of how to clone a partition dynamically at runtime:
soa_domain
).mds-soa
for the repository and soa-infra
for the partition).It is often difficult to navigate through Metadata MBeans, which are accessible from Fusion Middleware Control, particularly if the same configurations need to be duplicated across multiple environments. To maintain consistency, an easy and reusable method is to invoke a WLST command and enter the following metadata partition cloning command provided to clone the soa-infra
partition in the mds-soa
repository to another partition in the same repository:
cloneMetadataPartition(fromRepository='mds-soa', fromPartition='soa-infra', toRepository='mds-soa', toPartition='soa-custom')
As seen in the following screenshot, you will find the newly created soa-custom partition:
Moving composite(s) from one environment to another is an activity that will constantly engage your work as the platform administrator. As an example, you may want to move composites from a development system to a test system and then to a production system. The most effective and convenient approach is to transfer the entire metadata repository and/or the partition. Transferring the metadata gives you an option to not only move composite applications targeted to it but also customizations that are made and tested at runtime. In order to transfer metadata from one partition to another, you will need to first export it from a partition on the source environment and then import it into a partition on the target environment. Depending on your preference, you can either use a graphical interface via Fusion Middleware Control or a scripted approach via WLST. It is our recommendation that you use scripts as much as possible, as they are efficient, save time, and only require small customizations. The following steps specify the way to export all composites from a partition from the MDS Configuration dashboard, as shown in Figure 8.10:
It is important that the export directory specified exists either on the machine where the SOA server is running or where the browser is running, depending on the export option selected. The browser does not prompt you to browse for a filesystem path. If the location does not exist in the filesystem, a directory is created. However, when the name ends with .jar
or .zip
, an archive is created. If a directory name is specified, then the metadata archive is written to a subdirectory of the directory specified with the name of the partition that was exported as the name of the subdirectory.
In order to similarly export items from within an MDS repository and import them to another server using the WLST command line, follow the steps listed here:
wslt.sh
file to administer an MDS repository on the source server instance from the $ORACLE_HOME/common/bin
directory:cd $ORACLE_HOME/common/bin ./wlst.sh
exportMetadata()
command to extract all composites and metadata deployed to a partition in a temporary folder:wls:/offline>connect('<username>', '<password>', '<host>:<adminport>') wls:/DomainName/serverConfig>exportMetadata(application='soa-infra', server='<soa_managed_server>', toLocation='<export_folder>', docs='/**') wls:/DomainName/serverConfig>exit()
If you are unsure about the composite name, you can obtain it from the composite dashboard from Fusion Middleware Control. The server name has to be the server to which the MDS repository is targeted. The /**
wildcard filter indicates that all documents from the root folder will need to be extracted out. However, you can even specify a path filter to traverse the MDS path internally to export any desired file or folder. The following WLST command illustrates how to export all the .xml
files from the /soa/configuration/default
directory under the MDS root:
exportMetadata(application='soa-infra', server='soa_server1', toLocation='export_folder',docs='/soa/configuration/default/*.xml')
importMetadata()
command to import the exported metadata archive into the target server:wls:/DomainName/serverConfig>importMetadata(application='soa-infra', server='<soa_managed_server>', fromLocation='import_folder', docs='/**')
3.15.34.39