X

Proactive insights, news and tips from Oracle WebLogic Server Support. Learn Oracle from Oracle.

Migrating from Generic Data Source to Active GridLink

Stephen Felts
Manager

Earlier, I wrote an
article about how to migrate from a Multi Data source (MDS) for RAC
connectivity to Active GridLink (AGL). This is needed to move from the older datasource technology to the newer
technology, both supporting Oracle RAC. The
information is now in the public documentation set at http://docs.oracle.com/middleware/1221/wls/JDBCA/gridlink_datasources.htm#JDBCA690.

There are also many customers that
are growing up from a standalone database to an Oracle RAC cluster. In this case, it’s a migration from a GENERIC
datasource to an AGL datasource. This
migration is pretty simple.

No changes should be required to
your applications.  A standard application looks up the datasource in JNDI
and uses it to get connections.  The JNDI name won’t change.

The only changes necessary should be
to your configuration and the necessary information is generally provided by
your database administrator.   The information needed is the new URL
and optionally the configuration of Oracle Notification Service (ONS) on the
RAC cluster. The latter is only needed if you are running with

- an 11g driver or 11g database.
Auto-ONS depends on protocol flowing between the driver and the database server
and this feature was added in 12c.

- pre-WLS 12.1.3. Auto-ONS is supported starting in WLS 12.1.3.

- an Oracle wallet with SSL
communications. Configuration of the
wallet requires also configuring the ONS information.

- complicated ONS topology. In general, auto-ONS can figure out what you
need but there are cases where you need to specify it precisely. In WLS 12.2.1, an extension of the ONS
configuration allows for specifying the exact topology using a property node
list. See http://docs.oracle.com/middleware/1221/wls/JDBCA/gridlink_datasources.htm#BABGJBIC
for more information.

The
URL and ONS attributes are configurable but not dynamic. That means that the datasource will need to
be shutdown and restarted after the change. The simplest way to do this is to untarget the datasource, make the
changes, and then re-target the datasource.

The recommended approach to migrate from a GENERIC to AGL datasource is to use WLST. The URL must be changed in the JDBCDriverParams
object. The new JDBCOracleParams object
(it generally doesn’t exist for a GENERIC datasource) needs to have FAN enabled
set to true and optionally set the ONS information.

The following is a sample WLST script with the new
values hard-coded. You could
parameterize it and make it more flexible in handling multiple datasources. If you are using an Oracle wallet for ONS,
that needs to be added to the JDBCOracleParams object as well.

# java weblogic.WLST file.py

import sys, socket, os

hostname = socket.gethostname()

datasource="JDBC Data Source-0"

connect("weblogic","welcome1","t3://"+hostname+":7001")

edit()

startEdit()

cd("/JDBCSystemResources/" + datasource )

targets=get("Targets")

set("Targets",jarray.array([], ObjectName))

save()

activate()

startEdit()

cd("/JDBCSystemResources/" + datasource + "/JDBCResource/"
+
datasource + "/JDBCDriverParams/"
+ datasource )

set("Url","jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS_LIST=("
+
"ADDRESS=(PROTOCOL=TCP)(HOST=dbhost)(PORT=1521)))" +
"(CONNECT_DATA=(SERVICE_NAME=otrade)))")

cd("/JDBCSystemResources/" + datasource + "/JDBCResource/"
+
datasource +
"/JDBCOracleParams/" + datasource )

set("FanEnabled","true")

set("OnsNodeList","dbhost:6200")
# The following is for WLS 12.1.2 and 12.1.3 if not setting FanEnabled true, which is not recommended
#set("ActiveGridlink","true")
# The following is for WLS 12.2.1 and later


#cd("/JDBCSystemResources/" + datasource + "/JDBCResource/"
+

# datasource )

#set("DatasourceType", "AGL")

save()

activate()

startEdit()

cd("/JDBCSystemResources/" + datasource )

set("Targets", targets)

save()

activate()

In WLS 12.1.2 and 12.1.3, there is an explicit ActiveGridlink flag that can be used to identify an AGL datasource, even if FanEnabled is not set to true (which is not recommended) and auto-ONS is used (12.1.2 is the first release in which auto-ONS is supported). In the script above, uncomment the line to set it only if FanEnabled and OnsNodeList are not set.

Starting in WLS 12.2.1, there is an explicit
datasource type at the JDBCResource level. If that is set to GENERIC, you must re-set it using set("DatasourceType",
"AGL"). In the script above,
uncomment the lines to set it.  In this case, the ActiveGridlink flag is not necessary.

In the administrative console, the database type is
read-only and there is no mechanism to change the database type. You can try to get around this by setting the
URL, FAN Enabled box, and ONS information. However, in 12.2.1 there is no way to re-set the Datasource Type in the
console and that value overrides all others.

Be the first to comment

Comments ( 0 )
Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.Captcha
Oracle

Integrated Cloud Applications & Platform Services