X

Proactive insights, news and tips from Oracle WebLogic Server Support. Learn Oracle from Oracle.

  • October 27, 2015

WLS Data Source Multitenancy

Stephen Felts
Manager

See the 
Blog
announcing Oracle WebLogic Server 12.2.1
for more details on Multenacy and other new features.

The largest and most innovative
feature in WebLogic Server (WLS) 12.2.1 is Multitenancy.  It is
integrated with every component in the application server.  As part of the
Multi-tenancy effort one of the key concepts being introduced is the notion of
a slice of the domain which is referred to as a Partition or Domain
Partition.  A Partition defines applications and resources for a specific
Tenant where each Partition's configuration and runtime are isolated from other
Partitions in the Domain.  Multi-tenancy is expected to reduce
administrative overhead associated with managing multiple domains and
application deployments, and to improve the density of these deployments, such
that operational and infrastructure costs are reduced.

The
concepts of the WLS MT feature are described
WebLogic Server Multitenant (MT).  The
details for MT data source are in the Configuring JDBC  chapter.  This
article summarizes the use of data sources in a MT environment and focuses on
finding your way around the administrative console and Fusion Middleware
Control.

When
working without the WLS Multi Tenant feature, a data source (DS) may be defined as a
system resource or deployed at the domain level. When using the Multi Tenant
feature, a data source may also be defined in the following scopes.

  • Domain
    • DS with global scope
    • Domain-level Resource Group
      with DS with global scope
    • Domain-level Resource Group
      Template with DS
    • Partition
      • Partition-level Resource
        Group with DS
      • Partition-level Resource
        Group based on Resource Group Template
      • Partition-level JDBC System
        Resource Override
      • Partition-level Resource
        Deployment Plan
      • Object deployed at the
        partition level

The following table summarizes the various deployment types and
the mechanism to update or override the data source definition.

Data
Source Deployment Type

Parameter
Override Support

Domain-level System Resource,
optionally scoped in RG

No override support – change the
DS directly.

RGT System Resource

Change the DS directly or override
in the RG derived from the RGT

Partition-level System Resource in
RG

No override support – change the
DS directly.

Partition-level System Resource in
a RG based on RGT

JDBC System Override or Resource
deployment plan.

Application Scoped/Packaged Data Source
deployed to domain or partition

Application Deployment plan.

Standalone Data Source Module
deployed to domain or partition

Application Deployment plan.

Data Source Definitions (Java EE
6) deployed to domain or partition

No override support.

Creating
a data source that is scoped to a Domain-level RG or in a Partition is similar
to creating a domain-level system resource. The only additional step is to
specify the scope. In the administration console or Fusion Middleware Control
(FMWC), there is a drop-down on the first step of creation that lists the
available scopes in which to create a data source. In WLST, it’s necessary to
create the data source using createJDBCSystemResource on the owner MBean (the
MBean for the domain, RG, or RGT).

The WLST example at Configuring
JDBC Data Sources: WLST Example

is very
useful in setting up a partitioned domain. It demonstrates creating a virtual target, partition, RGT, RG, and data
sources at all levels.

The remainder of this article focuses on the graphical user interfaces. 

In the administration console, start by selecting the Data Source
summary from the Home page. In this
first figure, we see the four data sources that were created by running the WLST script.  One is
global and the remaining three have various scopes within the partition. 

If we click on the
“ds-using-template” data source and look at the connection pool properties, we
see the original values for the data source based on the template.  The
overrides don’t show up at this level.

Selecting New on
the Data Source Summary page and creating a Generic Data Source, we can see the
drop-down Scope on the first page.  It changes based on the scopes that are currently available.

Back on the Home page, we can select
Domain Partitions and we see the one “partition1” partition with two resource
groups.

If we click on “partition1” and go
to the overrides page, we can see the JDBC override for “ds-in-template”. Note that the URL has now been overridden
from using “otrade” to “otrade2”.

Clicking on the “ds-in-template’
link allows for changing the overrides. Note that on this page, we can also see that the user has been
overridden to be “scott”.

You can create a new JDBC System Resource Override
by selecting New. The drop-down box for Data
Source lists the available resources for creating the override. The administration console currently lists
all RG in the partition. However, the
intent is that only RG derived from RGT should be allowed to have an
override. Non-derived RG should be
updated directly so it’s recommended not to override such groups (it may be
removed in the future).


Going back to the Home page, Data Sources, select a
Data Source, select Security, select Credential Mappings, then New, we can
enter new User, Remote User, Remote Password triplets

It’s possible to look at lists of data
sources at various levels. From the
domain level, the monitoring tab on the Data Sources page shows all running
data sources in all scopes
.

From the Partition page selecting “partition1”,
select Resource Group, select “partition1-rg”, select Services, select JDBC, we
see the one data source defined in this scope
.

Partition-scoped deployments are
handled as with non-partition scoped deployments, you start by selecting Deployments
from the Home page and then find the ear or war file that you want to
deploy. On the first page of the
“Install Application Assistant”, you can select the Scope as shown in the
following figure
.

Once you finish deploying the ear or
war file, you can see the associated modules in the console, with the
associated scope by clicking on the associated link. Initially there is no
deployment plan
.

Creating an application deployment
plan is a bit complex.  It's recommended to use the administration console
to create it automatically.  Simply go to the deployed data source, change
the configuration, and save the changes.  The console creates the
associated deployment plan and fills in the Deployment Plan name
.

If you want to override attributes
of a RGT-derived partition datasource that are not one of user, password, or
URL, you will need to create a Resource Deployment Plan. There is no automation in the console for
doing this. You can massage an
Application Deployment Plan to look like a Resource Deployment Plan or create
one from scratch using an XML editor. Here is an equivalent Resource Deployment Plan. 
To use the resource deployment plan, go to Home,
Domain Partitions, click on the Partition link, and type in the pathname in the
Resource Deployment Plan Path.

The capabilities in FMWC are similar to the
administrative console but with a different look and feel. FMWC currently does not have security pages;
data source security configuration must be done in the administration console.

If you select JDBC Data Sources from the WebLogic
Domain drop-down, you will see something like this.

Selecting Create brings up a page that includes a
Scope drop-down.

Selecting a resource group name brings up a page to
edit the RG.

Selecting an existing DS brings up a page to edit
the DS.

Selecting a partition name brings up a page to edit
the Partition attributes.

If you are looking for the Partition system resource
overrides, select the partition name, select the Domain Partition drop-down,
select Administration, then select Resource Overrides.

The page looks like this.

This page will list every RG that is derived from a
RGT. If there is no existing override,
the “Has Overrides” column will not have a check and clicking on “Edit
Overrides” will create a new override. If “Has Overrides” has a check, clicking on “Edit Overrides” will update
the existing overrides, as in the following figure.

The focus of this article has been on configuration of data sources in a Multi Tenant environment.  It is the intent that using an application in a Multi Tenant environment should be largely transparent to the application software.  The critical part is to configure the application server objects and containers to be deployed in the partitions and resource groups where they are needed.


Be the first to comment

Comments ( 0 )
Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.