- DC=myco,DC=com
- DC=corp,DC=myco,DC=com
- DC=dev,DC=myco,DC=com
- DC=acquiredco,DC=com
Step 1: Install python3-ldap and the manage_tns tool on to a Linux host
$ sudo install python3-ldap
$ cd /u01
$ curl -so manage_tns.sh https://raw.githubusercontent.com/oudlabs/manage_tns/refs/heads/main/manage_tns.sh
$ chmod 0700 manage_tns.sh
Step 2: Backup the primary naming context
$ /u01/manage_tns.sh export -h <dshost> -p <ldaps_port> -f tnsnames.ora --suffix "DC=myco,DC=com"
$ /u01/manage_tns.sh export -h <dshost> -p <ldaps_port> -f tnsnames.ora --suffix "DC=myco,DC=com"
Step 3: Export the database entries from all other naming contexts
$ /u01/manage_tns.sh export -h <dshost> -p <ldaps_port> -f tnsnames-corp.ora --suffix "DC=corp,DC=myco,DC=com"
$ /u01/manage_tns.sh export -h <dshost> -p <ldaps_port> -f tnsnames-dev.ora --suffix "DC=dev,DC=myco,DC=com"
$ /u01/manage_tns.sh export -h <dshost> -p <ldaps_port> -f tnsnames-other.ora --suffix "DC=acquiredco,DC=com"
Step 4: Load the exported database entries into the primary naming context
$ /u01/manage_tns.sh load -h <dshost> -p <ldaps_port> -D <tns_admin_dn> -f tnsnames-corp.ora --suffix "DC=myco,DC=com"
$ /u01/manage_tns.sh load -h <dshost> -p <ldaps_port> -D <tns_admin_dn> -f tnsnames-dev.ora --suffix "DC=myco,DC=com"
$ /u01/manage_tns.sh load -h <dshost> -p <ldaps_port> -D <tns_admin_dn> -f tnsnames-other.ora --suffix "DC=myco,DC=com"
Step 5: Update client references to the new naming context in ldap.ora and JDBC connect lookups
DEFAULT_ADMIN_CONTEXT = "DC=myco,DC=com"
"jdbc:oracle:thin:@ldaps:<ds_host>:<ldaps_port>/<db_alias>,cn=OracleContext,DC=myco,DC=com"
Step 6: Obtain a list of all of the database entries from the legacy naming context
$ /u01/manage_tns.sh list -h <dshost> -p <ldaps_port> --suffix "DC=acquiredco,DC=com"
$ /u01/manage_tns.sh unregister -n <db_alias> -h <dshost> -p <ldaps_port> -f tnsnames-corp.ora --suffix "DC=corp,DC=myco,DC=com"
I hope you found this information helpful and insightful.
No comments:
Post a Comment