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

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 (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


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 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.





Join the discussion

Comments ( 2 )
  • Olivier Spiesser Friday, September 18, 2020
    Is there any other properties that must be set for LDAP URLs ?
  • Stephen Felts Tuesday, October 27, 2020
    A valid LDAP URL should be sufficient.
Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.