Active Gridlink : how to configure a JDBC gridlink datasource with RAC (12c)

Active Gridlink datasources are JDBC datasources:

  • that connect to a RAC server
  • that are “aware” of the state of the Oracle RAC server at anytime
  • that respond to FAN events to provide
    • Fast Connection Failover (FCF),
    • Runtime Connection Load-Balancing (RCLB),
    • and RAC instance graceful shutdown

What means that whatever happens to your RAC installation, your programs get always a JDBC working connection even when a RAC node brutally dies or that a node is simply shutdown for maintenance. Better, when the RAC node restart, the JDBC pool get balanced to use the restarted node.

Here is how to configure it:

1. Installation

You need to have :

  • a RAC installation of at least 2 nodes (mine is version
  • a JDeveloper or Weblogic installation to configure the JDBC Gridlink  datasource (mine is JDeveloper 12.1.3)
  • a java code sample to check if it works ( GridLinkTest )

If you do not have such install, you follow an blog like this one, to install RAC on VirtualBox.

2. Schema of the installation

3. Check the RAC installation:

First, let’s see if the RAC is working.

  • The database is called “racdb”.
  • It is not a PDB database.
  • It is running on 2 rac nodes racdb_1 and racdb_2
  • The nodes are on machine rac1 and rac2.
  • They are started.

You can also check the database listener:

  • The database service name is racdb

And the ONS service:

The ONS service is started on port 6200 on (rac1) and (rac2).

4. Create the datasource

Go in Weblogic console,

  • for a standalone WLS: something like http://machine:7001/console,
  • or for JDeveloper: http://machine:7101/console

Then in the menu, click Data Sources


Click New /  GridLink Data Source

In step 1: “JDBC GridLink Data Source Properties”
  • Name of the connection : jdbc/gridlinkDS
  • JDNI name: jdbc/gridlinkDS
  • Database driver:
    *Oracle’s Driver (Thin) for GridLink Application Continuity Connections; Versions:Any
  • Click Next


In step 2: “Transaction Options “
  • Keep the default (one phase commit) and Next
In step 3: “GridLink data source connection Properties Options”
  • Check: Enter complete JDBC URL
  • Click Next
In step 4 : “connection properties”
  • JDBC URL :

1) I use the JDBC DESCRIPTION format
2) the HOST NAME is the SCAN hostname. The port and service name are the one we found above (1521 and racdb)

  • username: scott
  • password: tiger
  • Click Next


In step 5 “Test GridLink Database Connection”
  • Click “Test All Listeners” (it should work)
  • Click Next
In step 6 “ONS Client Configuration”
  • We will enter the ONS server found above
    ONS host and port:  (Click Add)  (Click Add)
  • Click Next


In step 7 “Test ONS client configuration “
  • Click “Test All ONS Nodes” (it should work)
  • Click Next
In step 8 “Select Targets”
  • Select the managed server where you will run the program.
    In my case, it is the DefaultServer of the integrated WLS of JDeveloper


  • Click Finish

5. Deploy the test application:

Here is the source of the program and the war file: GridLinkTest

  • Please download it.

You can run it from JDeveloper. Or deploy the WAR file from the WLS console:

  • Go to WLS console : http://machine:7001/console
  • In the domain structure, click deployment
  • Click Install
  • Choose the war file (WLSWeb.war) and deploy it

6. Test

Test 1 – With 2 rac nodes started
  • Go to http://machine:port/WLSWeb/TEST/gridlinkTest.html
  • Set Data Source Location to : jdbc/gridlinkDS
  • Connections to retrieve : 10


  • Click “Test JDBC Gridlink Data Source”

You will see that some of the connections are on rac1 and some on rac2. Ex:


Test 2 : stop RAC node 2

Go to the SSH console of your RAC installation.
Stop the node racdb_2.

Go back to http://machine:port/WLSWeb/TEST/gridlinkTest.html

  • Same input than above
  • Click “Test JDBC Gridlink Data Source”
  • You will see only rac1 connections.


If you set up ONS debugging, you will see in the Weblogic log a lot of new log entries like

Test 3 : Restart the node rac2

Go back to http://machine:7001/WLSWeb/TEST/gridlinkTest.html

  • Same input
  • Click Test JDBC Gridlink Data Source
  • You will see rac1 and rac2 connections.







Leave a Reply

Your email address will not be published. Required fields are marked *