Skip Navigation Links | |
Exit Print View | |
Oracle Fusion Middleware Command-Line Usage Guide for Oracle Unified Directory 11g Release 1 (11.1.1) |
The ldif-diff command identifies the differences between two LDIF files.
ldif-diff options
The ldif-diff command can be used to identify the differences between two LDIF files. The resulting output can be displayed on the terminal or saved to an output file. The resulting output contains all of the information necessary for someone to reverse any changes if necessary. For modify operations, only sets of add and delete change types are used, not the replace change type. For delete operations, the contents of the entry that has been removed are included in the changes displayed in the form of comments.
This command was designed to work on small data sets. It is only suitable in cases in which both the source and target data sets can fit entirely in memory at the same time. It is not intended for use on large data sets that cannot fit in available memory.
The ldif-diff command accepts an option in either its short form (for example, -o outputFile) or its long form equivalent (for example, --outputLDIF outputFile).
Specify a file containing a list of attributes to ignore when computing the difference
Consider the syntax of the attributes as defined in the schema to make the value comparison. The specified LDIF files must be conform to the server schema.
Specify a file containing a list of entries (DNs) to ignore when computing the difference
Specify the path to the output file to record the changes between the source and target LDIF data. If this is not provided, then the change information will be written to standard output.
Overwrite the output file specified with the --outputLDIF option. This option indicates that if the specified output file already exists that the file should be overwritten rather than appending to it. The option is only applicable if --outputLDIF is used.
Specify the path to the source LDIF file, which contains the original data with no changes applied. This option is required.
Run in Single Value Change mode, in which each modify operation is broken into a separate modification per attribute value. For example, if a single modification adds five values to an attribute, the changes appear in the output as five separate modifications, each adding one attribute.
Specify the path to the target LDIF file that contains the differences from the source LDIF. This option is required.
Display command usage information and exit without attempting to perform any additional processing.
Display the directory server version information and exit rather than attempting to run this command.
The following examples show how to use the directory server commands. See System Requirements and Certification in Oracle Fusion Middleware Installation Guide for Oracle Unified Directory for more information.
Example 4-9 Comparing Two LDIF files and Sending the Differences to Standard Output
The following command compares a source file (-s) with a target file (-t) and outputs the differences. For Windows platforms, specify the paths for the source file (for example, -s \temp\quentin.ldif) and the target file (for example, -t \temp\quentin.ldif):
$ ldif-diff -s /usr/local/quentin.ldif -t /usr/local/quentinr.ldif dn: uid=qcubbins,ou=People,dc=example,dc=com changetype: delete # objectClass: person # objectClass: organizationalPerson # objectClass: top # objectClass: inetOrgPerson # cn: Quentin Cubbins # sn: Cubbins # uid: qcubbins # userPassword: qcubbins # givenName: Quentin # description: This is Quentin's description. # mail: qcubbins@example.com dn: uid=qrcubbins,ou=People,dc=example,dc=com changetype: add objectClass: person objectClass: organizationalPerson objectClass: top objectClass: inetOrgPerson cn: Quentin R Cubbins sn: Cubbins uid: qrcubbins userPassword: qrcubbins givenName: Quentin description: This is Quentin R's description. mail: qrcubbins@example.com
Example 4-10 Comparing Two LDIF files and Sending the Differences to a File
The following command compares a source file (-s) with a target file (-t) and sends the output to a file (-o). For Windows platforms, specify the paths for the source file (for example, -s \temp\quentin.ldif) and the target file (for example, -t \temp\quentin.ldif):
$ ldif-diff -s /usr/local/quentin.ldif -t /usr/local/quentinr.ldif \ -o output.ldif
An exit code of 0 indicates that the operation completed successfully. An exit code of 1 or greater indicates that an error occurred during processing.
UNIX and Linux: instance-dir/OUD/bin/ldif-diff
Windows: instance-dir\OUD\bat\ldif-diff.bat