Professional Documents
Culture Documents
August 2011
Introduction
WebLogic Server has been optimized with a new feature called Active GridLink for RAC since 10.3.4.
This feature integrates WebLogic Server data sources in a new architectural approach with Oracle RAC.
Specifically, Oracle RAC supports an event based client notification mechanism to disseminate
information about the state of an Oracle RAC cluster. The Active GridLink for RAC feature, manifested in
WebLogic Server as a GridLink data source type, further optimizes the proven WebLogic Server data
source infrastructure by leveraging the information within these RAC notifications to provide better
overall connectivity in the form of significantly faster response to RAC node failures or maintenance
activities, better utilization of RAC cluster resources and improved runtime monitoring and management.
Perhaps most importantly, the intelligent runtime processing of this RAC event information has resulted
dramatically improved performance results for WebLogic based OLTP database workloads on Web Logic
and Exalogic.
WebLogic Server receives load balancing advisory events issued by the database, and distributes
connections to the Oracle RAC nodes accordingly. This has been made available as a Runtime Load
Balancing configuration option on the Active GridLink for RAC data source. Enabling it dictates that the
pool dispatch connections based on the advisories it has received from the database achieving an
outcome where the connections are directed to a specific database node to satisfy a performance goal
the database administrator has set.
XA Affinity
XA affinity is a performance feature that ensures that all database operations performed on an Oracle
RAC cluster within the context of a global transaction are directed to the same Oracle RAC instance.
Affinity will be established based on the global transaction id, instead of by individual data source, to
ensure that connections obtained from different data sources that are configured for the same Oracle
RAC cluster are all associated with the same RAC instance.
Objectives
Create database Service to access RAC database.
Configuration of GridLink data source.
Deployment of GridLink demo application.
Running of demo application to show fast connection failover, load balancing and XA Affinity.
Prerequisites
1. WebLogic 10.3.5 is required for this workshop. If its not installed already, here its the
download url:
http://www.oracle.com/technetwork/middleware/fusion-middleware/downloads/index.html
2. Oracle Database RAC 11gR2 is required for this workshop. A physical or VM installation works.
Here its for more information regarding RAC:
http://www.oracle.com/technetwork/database/clustering/overview/index.html
3. Knowledge of Java EE and Oracle RAC is required.
4. Click New
8. At this page:
Click Next.
10. At this page:
Click Next
Click Next
12. Select WebLogic Server Target
Click Finish
Repeat step 3-12 to configure multiple GridLink Data Sources. We will use the following for the
workshop:
Name: racDS
Jndi name: jdbc/racDS
Name: racDS1
Jndi name: jdbc/racDS1
Name: racDS2
Jndi name: jdbc/racDS2
Click Install
Upload your application:
Install as an application
Demonstrates RAC transaction affinity by allowing users to order a combination of stocks both
inside and outside a global transaction)
15. Click Stock purchase batch procession
This application can be used to demonstrate the Load Balancing and Fast Connection Failover
RAC features used in WebLogic (Active GridLink).
In order to demonstrate Load Balancing submit the form below and notice stock purchases are
made using different RAC nodes.
In order to demonstrate Fast Connection Failover shutdown one of the RAC nodes in the cluster
(for example by issuing 'srvctl stop instance -d ORCL -i ORCL1') during this process and notice the
connection pool is cleaned and connections are directed to remaining node. Then restart the
node that was shutdown and notice the pool is once again populated with connections from
restarted node in order to resume load balance capability.
Enter the number of stock purchases of ABCD to process (each insert uses a separate database
connection)
100
Enter the number of stock purchases of ABCD to process per batch (connections are closed at
the end of each batch)
10
Click submit
From bottom of this page, the connections shown are routed to instance 2 - wlsqadb2
Bring instance 1 wlsqadb1 backup:
srvctl start instance -d orcl1 -i wlsqadb1
(or could be done by dbconsole)
i: instance name
d: database name
s: service name
From bottom of this page, you could see that the connections are balanced to both instances
again.
This shows fast connection failover and re-join case.
16. Purchase stocks
Go back to the front page of the application:
This application can be used to demonstrate the global transaction RAC affinity feature in Active
GridLink.
In order to demonstrate global transaction RAC affinity, submit the form with the option to
purchase shares in a global transaction and notice both the bank account datasource and
brokerage account datasource use the same RAC node.
You will need to use two different GridLink Data Sources for this application.
Option 1:
Select Yes for Purchase shared in global transaction option.
Click submit
You will see the connections are routed to same RAC instance. This leverages XA Affinity for
performance by saving cluster wait time at backend.
Option 2:
Select No for Purchase shared in global transaction option.
Click submit
You will see the connections are routed to both RAC instances without XA Affinity.