X

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

  • November 8, 2016

AGL Datasource Support for URL with @alias or @LDAP

Stephen Felts
Manager

The Oracle driver has the ability to have an @alias string in the connection string URL so that the information like the host, port, and service name can be in an external tnsnames.ora file that is shared across many datasources. My perception is that this has grown in popularity in recent years to make management of the connection information easier (one place per computer).  In an effort to centralize the information further, it's possible to use an @LDAP format in the URL to get the connection information from a Lightweight Directory Access Protocol (LDAP) server.  See the Database JDBC Developer's Guide, https://docs.oracle.com/database/121/JJDBC/urls.htm#JJDBC28267, for more information.

While this format of URL was supported for Generic and Multi Data sources, it was not supported for Active GridLink (AGL) datasources.  An AGL datasource URL was required to have a (SERVICE_NAME=value) as part of the long format URL.  

Starting in WebLogic Server 12.2.1.2.0 (AKA PS2), the URL may also use an @alias or @ldap format.  The short format without an @alias or @LDAP is still not supported and will generate an error (and not work).  It is highly recommended that you use a database service name in the stored alias or LDAP entry.  Do not use a SID.  To optimize your AGL performance, you should be using a long format URL, in the alias or LDAP store, that has features like load balancing, retry count and delay, etc.

 

ALIAS Example:

1. Create a tnsnames.ora file with

tns_entry=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=RAC-scan-address)(PORT=port))(CONNECT_DATA=(SERVICE_NAME=service)))

Normally, it is created in $ORACLE_HOME/network/admin. 

2. Create your WLS datasource descriptor using a URL like  "jdbc:oracle:thin:/@tns_entry"

3. Add the following system property to the WebLogic server command line:-Doracle.net.tns_admin=$ORACLE_HOME/network/admin

 

LDAP Example:

1. Create your WLS datasource descriptor for LDAP or LDAPS using a URL like ""jdbc:oracle:thin:@ldap://ldap.example.com:7777/sales,cn=OracleContext,dc=com"

JDBC Driver Requirement

 

Here's the catch.  You need to use a smarter ucp.jar file to support this functionality.  There are two options:

 

- Get a WLS patch to the 12.1.0.2 ucp.jar file based on Bug 23190035 - UCP DOESN'T SUPPORT ALIAS URL FOR RAC CLUSTER

- Wait to run on an Oracle Database 12.2 ucp.jar file.  I'll be writing a blog about that when it's available.

 

 

 

 

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