The dereference of aliases is unfortunately not supported by the 389ds ldap server. Therefore here is a small plugin which resolves aliases during base search. Subtree and onelevel searches are not supported.
yum install 389-ds-base-devel
make
cp libalias-base-plugin.so /usr/lib64/dirsrv/plugins
chown root:root /usr/lib64/dirsrv/plugins/libalias-base-plugin.so
chmod 755 /usr/lib64/dirsrv/plugins/libalias-base-plugin.so
ldapadd -H ldap://ldapserver -D "cn=Directory Manager" -W -f alias-base.ldif
systemctl restart dirsrv@ldapserver
ldapdelete -H ldap://ldapserver -D "cn=Directory Manager" -W "cn=alias-base,cn=plugins,cn=config"
systemctl restart dirsrv@ldapserver
rm /usr/lib64/dirsrv/plugins/libalias-base-plugin.so
Consider you have the Oracle database MYDB, and you keep your tnsnames in the LDAP:
dn: cn=MYDB,cn=OracleContext,dc=world
objectClass: top
objectClass: orclNetService
cn: MYDB
orclNetDescString: (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=DBHOST)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=MYDB)))
Now you have migrated the data from the other db MYOLDDB into this MYDB. On the clients side the tnsname MYOLDDB is still configured. To enable clients to connect to the new DB without changing their settings, you can create an alias like this:
dn: cn=MYOLDDB,cn=OracleContext,dc=world
objectClass: top
objectClass: alias
objectClass: orclNetServiceAlias
cn: MYOLDDB
aliasedObjectName: cn=MYDB,cn=OracleContext,dc=world
Here is what happening with and without plugin:
without plugin | with plugin |
---|---|
| |
|
|
| |
|
|
| |
|
|
| |
|
|