Configuring Oracle Real Application Cluster (RAC) with the application server
Oracle Real Application Cluster (RAC) is a "share-everything" database architecture in which two or more Oracle RAC nodes are clustered together and share storage. The RAC nodes are connected together with a high-speed interconnect that enables fast communication between the Oracle nodes. The nodes can exchange various categories of data block ownership information during startup, lock information, exchange transaction information and data, and so on.
About this task
To configure Oracle RAC by using Liberty, the following
server.xml config example should be used:
<variable name="part1" value="jdbc:oracle:thin:" />
<variable name="part2" value="@(DESCRIPTION=" />
<variable name="part3" value="(FAILOVER=ON)(LOAD_BALANCE=OFF)" />
<variable name="part4"
value="(ADDRESS=(PROTOCOL=TCP)(HOST=host1)(PORT=port1))" />
<variable name="part5"
value="(ADDRESS=(PROTOCOL=TCP)(HOST=host2)(PORT=port2))" />
<variable name="part6"
value="(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=name)))" />
<dataSource id="ds_id" jndiName="jdbc/ds_id ">
<jdbcDriver>
<library>
<fileset dir="path_to_oracle_jar" includes="ojdbcX.jar"/>
</library>
</jdbcDriver>
<properties.oracle
URL="${part1}${part2}${part3}${part4}${part5}${part6}" user="username"
password="password" />
</dataSource>
Note:
- FAILOVER and LOAD_BALANCE can be configured on or off depending on your installation.
- host1 and port1 are for the first Oracle RAC node, and host2 and port2 are for the second Oracle RAC node.
- If you are not using Oracle services, then service_name is the database name in the example. If you are using Oracle services, then service_name is the name of the services.
- The JDBC driver does not have to be nested, as it is in this example, but could also be specified by using the jdbcDriverRef dataSource attribute.
- The Oracle login credentials do not need to be specified as Oracle properties, the other methods of database authentication also work.