Oracle Weblogic Server : Creating a multi data source
The multi data source should be used when connecting to an Oracle RAC database. The multi data source is a data source abstraction that groups all the individual data sources that connect to each node of the Oracle RAC database.
Consider that the
The database is an Oracle RAC database with two nodes. The first node has an instance name
Before creating the multi data source, the individual data sources pointing to each RAC node must be created. Two data sources will be created with the names
The multi data source will be named
Carry out the following steps to create a multi data source:
The multi data source manages the application requests for a database connection and uses Algorithm Type to define the strategy for high availability.
If using the
The multi data source is responsible for managing the load and failover; so if the Oracle database uses the SCAN address feature, it's recommended to set up a GridLink data source instead.
Consider that the
DBApp
application requires an XA connection with a JNDI name jdbc/ds-XA
added to a database.The database is an Oracle RAC database with two nodes. The first node has an instance name
instance-rac01
and runs in the dbhost-rac01
hostname and listens to the port 1521
. The listener accepts requests to the service name dbservice-rac01
. The second node is the instance instance-rac02
, and it runs in the dbhost-rac02
hostname, listens to the port 1521
, and has a service name dbservice-rac02
.Before creating the multi data source, the individual data sources pointing to each RAC node must be created. Two data sources will be created with the names
ds-XA-rac01
and ds-XA-rac02
and with the JNDI names jdbc/ds-XA-rac01
and jdbc/ds-XA-rac02
. The multi data source will be named
ds-XA
and includes both data sources.Carry out the following steps to create a multi data source:
- Access the Administration Console with your web browser at
http://adminhost.domain.local:7001/console
. - Click on the Lock & Edit button to start a new edit session.
- Click on the plus sign to open the Services tree on the left, and then click on Data Sources.
- Click on the New button and then click on Generic Data Source.
- Type
ds-XA-rac01
in the Name field andjdbc/ds-XA-rac01
in the JNDI Name field. Leave the Database Type drop-down menu with the Oracle option selected. Click on the Next button. - Choose
*Oracle's Driver (Thin XA) for RAC Service-Instance connections; Versions:10 and later
from the Database Driver drop-down menu. Click on the Next button. - Then, click on the Next button in the Transaction Options page.
- On the Connection Properties page, type
dbservice-rac01
in the Service Name field,instance-rac01
in the Database Name field,dbhost-rac01
in the Host Name field, and1521
in the Port field. Complete the Database User Name, Password, and Confirm Password fields by typingdbuser
, anddbpwd
as the username and password respectively. Click on the Next button. - Click on the Next button in the Test Database Connection page.
- Select the All servers in the cluster radio button from the
PROD_Cluster
cluster. Click on the Finish button. - Repeat the previous steps and create another data source. Add
ds-XA-rac02
as Name,jdbc/ds-XA-rac02
as JNDI Name,dbservice-rac02
as Service Name,instance-rac02
as Database Name, anddbhost-rac02
in the Host Name field. - Create the multi data source by clicking on the New button then on the Multi Data Source link.
- Type
ds-XA
in the Name field andjdbc/ds-XA
in the JNDI Name field. Leave the other options as their default values. Click on the Next button. - Select the All servers in the cluster radio button from the
PROD_Cluster
cluster. Click on the Next button. - Select the XA Driver option. Click on Next.
- Select both data sources
ds-XA-rac01
andds-XA-rac02
from the left of the Add Data Source page. Click on the >> button in the center of both sides to move them to the right. Click on Finish. - Finally, click on the Activate Changes button.
ds-XA
was created with the data sources ds-XA-rac01
and ds-XA-rac02
as members.The multi data source manages the application requests for a database connection and uses Algorithm Type to define the strategy for high availability.
If using the
Failover
algorithm, be sure to enable the Failover Request if Busy checkbox of the multi data source.The multi data source is responsible for managing the load and failover; so if the Oracle database uses the SCAN address feature, it's recommended to set up a GridLink data source instead.
0 Comments