Tuesday, September 20, 2011

Load Balancing Part I: Oracle R12 EBS and Oracle 11g RAC- Manual process

I had to configure an Oracle R12 (12.1.1/12.1.3) E-Business Suite and two node Oracle 11gR2 RAC environment recently to take advantage of load balancing.

However, instead of using a hardware load balancer such as Cisco ACE, we had to find a manual process to implement this goal.

First stop was to review the documentation listed below on My Oracle Support (http://support.oracle.com):

Note # 380489.1 Using Load Balancers with Oracle E-Business Suite Release 12
Note # 603325.1 Using Cisco ACE Series Application Control Engine with Oracle E-Business Suite 12
Note # 226880.1 Configuration of Load Balancing and Transparent Application Failover
Note # 262298.1 Load Balancing Doesn't Balance the Number of Sessions Across All Available Nodes
Note # 887522.1 11gR2 Grid Infrastructure Single Client Access Name (SCAN) Explained

Note #1080674.1 JDBC Drivers and Failover Mechanisms (FCF, TAF, SCAN )
Note #1100024.1 Master Note for Oracle JDBC High Availability Features
Note #247135.1 How to Implement Load Balancing With RAC Configured System Using JDBC

Now, based on my experience with load balancers and Oracle, you should in most cases take the default setup of running your application middle tier server nodes in the default servlet mode to work with Cisco ACE and other hardware load balancers.

There is no compatibility with socket mode for hardware load balancers after discussions with Oracle support, you MUST run in servlet mode for hardware load balancing.

With that said, you could also use a web cache 10gAS application server to use software load balancing instead of the expensive hardware load balancer.

Our challenge was to implement a pure software load balance setup with Oracle R12 EBS and 11gR2 RAC environment with the ability to run the application middle tier nodes in socket mode for performance and application compatibility reasons.

Configure application middle tier environment for load balancing

First, we had to edit the following context variables on the apps tier for load balancing using context editor in the Oracle Applications Manager (OAM):


Make sure to run the Oracle R12 EBS autoconfig utility ($ADMIN_SCRIPTS_HOME/adautocfg.sh) after changing the above context variables in your app tier context file.

Note: take a backup of the context file before making changes in case you need to revert back to original configuration!

The above context variables for the apps tier should point to the load balance setup in tnsnames.ora on the two RAC cluster nodes as shown below:

(ADDRESS=(PROTOCOL=tcp)(HOST=node2-vip)(PORT=1521)) )
) )

So you will need to create the entry called VIS_BALANCE for example as shown in the above tnsnames.ora file for the app tier nodes and database tier RAC Nodes.

Configure listener.ora

Sometimes even if you setup load balancing correctly, the distribution will not be sent equally across the cluster nodes. To resolve this issue, there is an undocumented parameter you can set to avoid this problem in your listener.ora file.

vi listener.ora


Register listener and services

Now that we have completed these changes, we need to register the listener services for all nodes.

Then unset and reset the remote_listener parameter for node1.

sqlplus '/as sysdba'
alter system set remote_listener='' scope=both;
alter system register;
alter system set remote_listener='VIS_REMOTE' scope=both;
alter system register;

Stop and restart the database and listeners.

lsnrctl stop
lsnrctl start
lsnrctl reload

Verify that both listeners display both instances in the status and services output.
lsnrctl services
lsnrctl status

Since load balancing is a complex topic, we just scratched the surface here in this post to highlight a quick and easy way to implement manual load balancing at the database layer with Oracle R12 EBS and Oracle 11gR2 RAC.

Future post will cover how to load balance the application middle tier.

No comments: