Oracle® Internet Directory Administrator's Guide 10g (9.0.4) Part Number B12118-01 |
|
Syntax for LDIF and Command-Line Tools, 10 of 10
Use the OID Migration Tool when you are migrating data from application-specific repositories into Oracle Internet Directory. The OID Migration Tool produces an LDIF file, which is suitable for loading into a directory server by using the standard command-line tools. The input to this tool is a pseudo-LDIF file containing substitution variables. The tool is called ldifmigrator and it exists in ORACLE_HOME
/bin
.
The syntax of the ldifmigrator tool is as follows:
ldifmigrator [options] {parameter_name=value ...} {s_SubVar=value ... }
Table A-38 describes the command-line parameters used by this tool in further detail:
The following table describes a set of pre-defined substitution variables. If it is running in the lookup mode, the OID Migration Tool can automatically determine the values of these variables by looking them up in the Oracle Internet Directory.
The OID Migration Tool obtains the values of the pre-defined substitution variables only in the lookup
mode. Users can override the value of any of the previous variables in the lookup
mode by specifying the variable and a different value in the command line. The user can also specify substitution variables other than the ones listed in the following table and their values in the command line.
Consider the input file sample.dat
whose contents are as follows:
dn: cn=jdoe, %s_UserContainerDN% sn: Doe %s_UserNicknameAttribute%: jdoe objectClass: inetOrgPerson objectClass: orclUserV2 title: Member of Technical Staff homePhone: 415-584-5670 homePostalAddress: 234 Lez Drive$ Redwood City$ CA$ 94402 ou: %s_UserOrganization%
The following sections describe how the OID Migration Tool can be used to transform the previous template into a valid LDIF ready to be loaded into Oracle Internet Directory.
In this example, the Oracle directory server is present in the environment, and the deployment wants the migration tool to lookup the directory server to figure out certain substitution variables. It will issue the following command:
$ldifmigrator "input_file=sample.dat" "output_file=sample.ldif" -lookup "host=ldap.acme.com" "subscriber=acme" "s_UserOrganization=Development"
On executing this command, the directory server running on ldap.acme.com will be contacted and the following values of the substitution variables for the subscriber acme
will be obtained:
Variable Name | Value Obtained from ldap.acme.com |
---|---|
% s_UserContainerDN% |
|
%s_UserNicknameAttribute% |
|
In addition to these variables, the OID Migration Tool also honors the command-line variable called s_UserOrganization
and substitutes all occurrences of it with the value Development
. In this case the output of the tool stored in sample.ldif
is as follows (the substituted values are shown in italics):
dn: cn=jdoe,cn=Users,o=Acme,dc=com sn: Doe uid: jdoe objectClass: inetOrgPerson objectClass: orclUserV2 title: Member of Technical Staff homePhone: 415-584-5670 homePostalAddress: 234 Lez Drive$ Redwood City$ CA$ 94402 ou: Development
The same output as shown in the previous example could have been obtained by specifying all of the values in the command line (without using the -lookup
option). The following command-line example describes how one would use the Migration tool without the lookup
mode:
$ldifmigrator "input_file=sample.dat" "output_file=sample.ldif" "s_ UserContainerDN=cn=Users,o=Acme,dc=com" "s_UserNicknameAttribute=uid" "s_ UserOrganization=Development"
In some cases, a deployment would like to use the OID Migration Tool in the lookup mode but would also like to override the values of one or more of the pre-defined substitution variables. This can be done by specifying the override value in the command line. The following command line shows how one can set the UserNickNameAttribute to cn
overriding the default of uid
:
$ldifmigrator "input_file=sample.dat" "output_file=sample.ldif" -lookup "host=ldap.acme.com" "subscriber=acme" "s_UserOrganization=Development"
"s_UserNicknameAttribute=cn"
On executing this command, the directory server running on ldap.acme.com
will be contacted and the following values of the substitution variables for the subscriber acme
will be obtained:
Variable Name | Value Obtained from ldap.acme.com |
---|---|
% s_UserContainerDN% |
cn=Users,o=acme,dc=com |
%s_UserNicknameAttribute% |
uid (this is over-ridden by command-line specification) |
Since s_UserNicknameAttribute
is specified on the command line, the OID Migration Tool will ignore the value obtained from the directory and use the value specified in the command line. In addition to these variables, the migration tool will also honor the command-line variable called s_UserOrganization
and substitute all occurrences of it with the value Development
. In this case the output of the tool stored in sample.ldif
will be as follows (the substituted values are shown in italics):
dn: cn=jdoe,cn=Users,o=Acme,dc=com sn: Doe cn: jdoe objectClass: inetOrgPerson objectClass: orclUserV2 title: Member of Technical Staff homePhone: 415-584-5670 homePostalAddress: 234 Lez Drive$ Redwood City$ CA$ 94402 ou: Development
Using the load capability the users of this tool could directly load the data into Oracle Internet Directory. If an entry is already present in the directory then that directory entry will be logged to the file. The addition of the directory entries could fail for other reasons as well, for instance not enough permission to add or parent entry not being present. The command line tool will now take a new option -load
, which will load the user information to the directory.
The user migration tool capabilities available in Oracle Application Server 10g (9.0.4) are only useful when an older version of the iAS component is the only source of truth for all users being migrated to Oracle Internet Directory. However, in a practical deployment, the following scenarios arise:
To address these requirements, a new option -reconcile,
has been added to the user migration tool. This option requires an argument: -reconcile SAFE | SAFE_EXTENDED | NORMAL.
This option should be used when the user would like to append the only those attributes that are not already present in the directory. In the case of the above user entry, the user migration tool will parse this LDIF entry and substitute the values for s_subscriber_user_base
and s_nickname_attr
. After this, the tool will retrieve the jsmith entry from the directory. If the directory does not contain an entry for jsmith
then it would simply add this entry for the first time. On the other hand if the entry already exists with attributes as defined above then it will add only those attributes that are not present in directory. In the above case it will add only homePhone
and homePostalAddress
.
Now the Jsmith
entry in the directory will be:
dn: cn=jsmith, dc=oracle, dc=com cn: jsmith sn: Smith orclGlobalID: 86A8485163303EBEE034080020AB67AA uid: jsmith objectClass: inetOrgPerson objectClass: orclUser2 title: Member of Technical Staff
homePhone: 650-584-5670 homePostalAddress: 232 Gonzalez Drive$ San Francisco$ CA$ 94404
This option can be used when the user would like to overwrite attributes that are present in the directory. In the case of the above user entry, the user migration tool will parse this LDIF entry and substitute the values for s_subscriber_user_base
and s_nickname_attr
. After this, the tool will retrieve the jsmith
entry from the directory. If the directory does not contain an entry for jsmith
then it would simply add this entry for the first time. On the other hand if the entry already exists with attributes as defined above then it will add only those attributes that are not present in directory. In addition to this the attribute that is already present will be deleted and freshly added with new value. In the above case it will add homePhone
and homePostalAddress
and replace the attribute value for the attribute title
with the new value.
Now the Jsmith
entry in the directory will be:
dn: cn=jsmith, dc=oracle, dc=com cn: jsmith sn: Smith orclGlobalID: 86A8485163303EBEE034080020AB67AA uid: jsmith objectClass: inetOrgPerson objectClass: orclUser2 title: Principle Member of Technical Staff
homePhone: 650-584-5670 homePostalAddress: 232 Gonzalez Drive$ San Francisco$ CA$ 94404
This option can be used when the user would like to add the values to existing attributes. In the case of the above user entry, the user migration tool will parse this LDIF entry and substitute the values for s_subscriber_user_base
and s_nickname_attr
. After this, the tool will retrieve the jsmith
entry from the directory. If the directory does not contain an entry for jsmith
then it would simply add this entry for the first time. On the other hand if the entry already exists with attributes as defined above then it will add the attributes homePhone
and homePostalAddress
and the new value will be added to the existing title
attribute.
Now the Jsmith
entry in the directory will be:
dn: cn=jsmith, dc=oracle, dc=com cn: jsmith sn: Smith orclGlobalID: 86A8485163303EBEE034080020AB67AA uid: jsmith objectClass: inetOrgPerson objectClass: orclUser2 title: Member of Technical Staff
title: Principle Member of Technical Staff
homePhone: 650-584-5670 homePostalAddress: 232 Gonzalez Drive$ San Francisco$ CA$ 94404
The OID Migration Tool can display these error messages:
When an error condition occurs, the log messages are logged to this file: ORACLE_HOME
/ldap/install/LDIFMig_YYYY_MM_DD_HH_SS.log
.
|
![]() Copyright © 1999, 2003 Oracle Corporation. All Rights Reserved. |
|