Oracle DBA Tips Corner |
|
Loading a LDIF file created with ldifwrite
by Jeff Hunter, Sr. Database Administrator
Contents
Overview
When the OID command tool ldifwrite is used to unload directory data, by default,
it also unloads operational attributes, such as orclguid, creatorsname,
createtimestamp, modifiersname and modifytimestamp. Then when using
the OID command tool ldapadd to load this LDIF file, these attributes result in a
runtime error: ldap_add: Constraint violation.
This procedure will present a script that can be used to remove these entries from the LDIF
file allowing you to proceed with the load.
NOTE: the script will retrieve the entries to verify that the command worked.
In addition, the object class top contains these operational attributes, to
maintain the user-password state information for each user entry.
All articles, scripts and material located at the Internet address of http://www.idevelopment.info is the copyright of Jeffrey M. Hunter
and is protected under copyright laws of the United States. This document may not be hosted on any other site without my express,
prior, written permission. Application to host any of the material elsewhere can be made by contacting me at jhunter@idevelopment.info.
I have made every effort and taken great care in making sure that the material included on my web site is technically accurate,
but I disclaim any and all responsibility for any loss, damage or destruction of data or any other property which may arise from
relying on it. I will in no case be liable for any monetary damages arising from such loss, damage or destruction.
The purpose of this document is to provide a script that can be usd to
remove operational attributes from a LDIF file before loading it to the directory.
Fix LDIF File For Reloading
NOTE:
If the LDIF file was created with ldapsearch rather than ldifwrite,
this is not a problem as operational attributes are not unloaded and written to the LDIF file at all.
# chmod +x fixLDIFFile
====================COPY EVERYTHING BELOW THIS LINE============================
#!/bin/ksh
#
# fix ldifwrite file so it can be loaded into an existing OID database
#
print "Removing Offending Entries"
egrep -v "orclguid|creatorsname|modifiersname|createtimestamp|modifytimestamp|pwdchangedtime" dumped.ldif > new.ldif
print "Removing Offending Entries"
ldapmodify -a -c -p 389 -h alex -D cn=orcladmin -w
Tuesday, 23-Dec-2003 00:00:00 EST
Page Count: 7558