Oracle Internet Directory: Bulk Loading a Large User Base

During a planned environment migration, the need to move a large number of users quickly becomes paramount. There are several mechanisms to do this with OID, but most of them take far too long and have a huge hit on performance. Take for example, importing an LDIF file through the ODSM console. With a file containing roughly 600,000 users, this would take an average of 33 hours! Enter the bulkload tool. From start to finish, the same import takes under 10 minutes. How is that for an improvement? But, we don’t want to discuss all the benefits of the bulkload tool do we? Just show me how to do it, right? Here is how:

  1. Set ORACLE_HOME to your OID home (ex: /u01/app/oracle/Middleware/Oracle_IDM1)
  2. Set ORACLE_INSTANCE to your OID instance home (ex: /u01/app/oracle/Middleware/asinst_1)
  3. Copy your LDIF file to $ORACLE_HOME/ldap/bin
  4. Stop your OID instance
  5. Run the following command:

./bulkload connect=”oiddb” check=”TRUE” generate=”TRUE” file=”$ORACLE_HOME/ldap/bin/users.ldif”

Note: The “connect” string can be found in the tnsnames.ora file located in $ORACLE_INSTANCE/config. Despite what the documentation says, it is NOT the service name. It is the name at the beginning of the string.

  1. You will be prompted for the OID password. This is the ODS schema password.
  1. The script will build all the files it requires under $ORACLE_INSTANCE/OID/load. Basically, it builds data files for every attribute/objectclass in use. Non-indexed attributes will not be shown…but worry not, they will be written.
  1. Now, time to do the actual import. Run the following command from the same location:

./bulkload connect=”oiddb” load=”TRUE”

  1. Sit back, relax, and watch how quickly the import executes
  2. Restart OID, and connect to ODSM to verify the number of entries.
  3. Marvel at your ingenuity