Liquibase Enterprise was formerly known as Datical DB.

LDAP Connection to an Oracle Database

Using an LDAP Connection to an Oracle Database

Use this type of connection to use a service definition stored on the LDAP server for the connection information to use. The connection information is substituted in parameters in the JDBC driver when the connection is attempted. 

Supported LDAP Services

Oracle Internet Directory (OID) is the LDAP service supported. 

Liquibase Enterprise supports simple bind authentication through LDAP using an anonymous (empty) bind DN. 

Constraints on Liquibase Enterprise Features for Oracle

Prerequisite: LDAP Server Access

These instructions assume that you have done the following:

  • The Liquibase Enterprise host can access the LDAP server through the network. 
  • You have access to the LDAP server and can create service definitions there. 

1. Create the Service Definition on the LDAP Server

Use LDAP commands to create the service definition to use. 

In the following example, the service definition on the LDAP server is named ORA_AWS_LDAP. You may name it as you wish. Use this name for the TNS Alias setting in Liquibase Enterprise projects. 

cn=ORA_AWS_LDAP,cn=OracleContext,dc=us,dc=oracle,dc=com
objectclass=top
objectclass=orclNetService
cn=ORA_AWS_LDAP
orclnetdescstring=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCPS)(HOST=aws-db1-rhel6.datical.net)(PORT=2484)))(CONNECT_DATA=(SERVICE_NAME=pdborcl.datical.net)))


2. Create a Directory for Oracle Configuration Files

Create a directory on the host where you run Liquibase Enterprise to use for the wallet file and Oracle configuration files. 

The example places it in the oracle_ldap directory under the <project> directory in the default location for Liquibase Enterprise projects.  If Oracle is installed on the host, another common location might be $ORACLE_HOME/network/admin.  

Linux

/datical/oracle_ldap

Windows

C:\datical\oracle_ldap

3. Add Configuration Files to the Directory

FileDesription
sqlnet.ora

Profile configuration file for the Oracle database client. 

Copy this file from the Oracle database server.

ldap.ora

Configuration file that maps net service names to connect descriptors.

Copy this file from the Oracle database server.

sqlnet.ora

Profile configuration file for the Oracle database client. It specifies the lookup order for connection methods using the NAMES.DIRECTORY_PATH property. Example:  TNSNAMES,LDAP,EZCONNECT. 

Edit the file so that LDAP is the first connection method listed.  Be sure to include all of the connection types that are valid in your environment, and to order them in your order of preference for connection types.  Only exclude the connection types that aren't appropriate in your environment. 

For example:  If you prefer connections to be LDAP, but if there is an issue with LDAP should try TNSNAMES, and if TNSNAMES also doesn't work then fall back to EZCONNECT, it would look like this:

NAMES.DIRECTORY_PATH=(LDAP,TNSNAMES,EZCONNECT)

ldap.ora

Configuration file that identifies the server, server type, and context to use in the connection. 

During connection, the servers listed in DIRECTORY_SERVERS are contacted in order to confirm that the service definition exists on LDAP server.  

If the service definition does not exist on any server, the connection fails. 

DEFAULT_ADMIN_CONTEXT = "ou=oracledatabases,dc=mycompany,dc=com"
DIRECTORY_SERVERS = (ldap_server1.mycompany.com:3060:3131, ldap_server2.mycompany.com:389:636, ...)
DIRECTORY_SERVER_TYPE = OID

Note

For DIRECTORY_SERVER_TYPE, only OID is supported (Oracle Internet Directory)

3. Set Environment Variables to Locate the Configuration Files

When attempting a connection, Liquibase Enterprise uses environment variables to find the configuration files, then gets information it needs from them. 

Take care to set the variables correctly. There is overlap in the search order. 

You need an environment variable for each path:

  • Directory path to sqlnet.ora
  • Directory path to ldap.ora

Directory Path to sqlnet.ora

Set an environment variable to contain the directory path of the sqlnet.ora file.

You have some flexibility in the environment variable to use. Liquibase Enterprise searches in the following order:  

  1. TNS_ADMIN
  2. ORACLE_HOME/network/admin

If the sqlnet.ora file is not found, the Oracle default order is used: TNSNAMES,LDAP,EZCONNECT. This will cause the connection to fail. 

Directory Path to ldap.ora

Set LDAP_ADMIN to the location of the ldap.ora file. You may use another variable. 

Liquibase Enterprise searches in the following order:

  1. LDAP_ADMIN
  2. TNS_ADMIN
  3. ORACLE_HOME/network/ldap/admin

4. Set Up Liquibase Enterprise Project DbDefs to Use the LDAP Connection

When you create a DbDef in a project and choose Oracle as the database type, you set the following property:

  • Connection Type - Choose TNSNAMES/LDAP
  • TNS Alias  - Specifies the service name in LDAP that contains configuration information for the connection.

See also Configuring Step Settings (DbDefs)#OracleDatabaseStepSettings

5. Testing the Connection

See Testing Oracle Connections


Copyright © Liquibase 2012-2022 - Proprietary and Confidential