Managing metadata repository partitions

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.

Managing metadata repository partitions

Figure 8.6: The default partition mds-soa is created with every Oracle SOA Suite 12c installation

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.

Creating a new partition

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:

  1. On the navigator, expand WebLogic Domain and then right-click on your SOA domain (for example, soa_domain).
  2. Then, click on System MBean Browser.
  3. Navigate to Application Defined MBeans | oracle.mds.lcm | Domain: [Domain_Name] | MDSDomainRuntime | MDSDomainRuntime and click on the Operations tab.
  4. Click on the createMetadataPartition operation and in the parameter list, enter a valid name on an existing MDS repository and a suitable partition name to be able to create a new partition.

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.

Cloning a partition

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:

  1. On the navigator, expand WebLogic Domain and then right-click on your SOA domain (for example, soa_domain).
  2. Then, click on System MBean Browser.
  3. Navigate to Application Defined MBeans | oracle.mds.lcm | Domain: [Domain_Name] | MDSDomainRuntime | MDSDomainRuntime and click on the Operations tab.
  4. Click on the cloneMetadataPartiton operation.
  5. In the parameter list, enter suitable values to clone an existing partition from an existing source repository to a target one (for example, mds-soa for the repository and soa-infra for the partition).
  6. Ensure that the partition name is unique for the new target repository. If the toPartition property is left blank, the name of the source partition is used for the target partition.
  7. Click on Invoke, as depicted in Figure 8.7, to clone a partition.
  8. Optionally, you can verify that the partition has been created by clicking on the repository in the navigation pane. The partition is listed in the Partitions table on the Metadata Repository home page.
Cloning a partition

Figure 8.7: Cloning an MDS partition from the MDSDomainRuntime MBean

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:

Cloning a partition

Figure 8.8: Cloning a partition from soa-infra to soa-custom

Exporting and importing composites from/to a 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:

  1. You can either export an individual composite or the whole MDS depending on your requirements. To export the entire partition, on the navigator, expand SOA and then right-click on soa-infra.
  2. Navigate to Administration | MDS Configuration.
  3. The MDS Configuration dashboard page shows the properties, such as the repository name, type, and partition being used by the infrastructure to be exported.
  4. Enter the filesystem location to save the archived MDS file, click on the Export button, and enter the fully qualified path to the export file, as shown here:
    Exporting and importing composites from/to a partition

    Figure 8.9: Exporting composites from an MDS partition

  5. If the Exclude base documents option is checked, only the customizations made to the composite are exported and not the base documents.
  6. Once the MDS archive is exported to the server filesystem, you may transfer/copy it to the target filesystem (if it is on a different machine altogether).
  7. Navigate to the MDS Configuration page on the target server and under the Import panel, either enter the location manually where the archive is copied or use the Browse button to go to the directory.
  8. Click on the Import button to import all the archived composites and their customizations on the partition of the target server.

Note

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:

  1. Execute the 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
    
  2. Connect to the server instance from the offline prompt and enter the 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')
    
  3. Next, copy the export folder containing the extracted archive to the machine where the target server is running.
  4. Open a new WLST command line prompt from the middleware installation on the destination machine.
  5. Execute the 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='/**')
    

Note

The value of the fromLocation parameter must be on the same system that is running WLST or on a mapped network drive or directory mount. Direct network references such as \sharedFolder epositories cannot be used though.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.15.34.39