Oracle® Internet Directory Administrator's Guide 10g (9.0.4) Part Number B12118-01 |
|
Syntax for LDIF and Command-Line Tools, 5 of 10
This section contains these topics:
To run shell script tools on the Windows operating system, you need one of the following UNIX emulation utilities:
Note:
http://sources.redhat.com
http://www.datafocus.com/
The bulkdelete command-line tool enables you to delete a subtree efficiently. It can be used when both an Oracle directory server and Oracle directory replication servers are in operation. It uses a SQL interface to benefit performance. For this release, the bulkdelete tool runs on only one node at a time.
This tool does not support filter-based deletion. That is, it deletes an entire subtree below the root of the subtree. If the base DN is a user-added DN, rather than a DN created as part of the installation of the directory, it is included in the delete. You must restrict LDAP activity against the subtree during deletion.
The bulkdelete tool uses this syntax:
bulkdelete.sh -connect connect_string -base "base_dn" -size number_of_entries -encode "character_set"
Mandatory Argument | Description |
---|---|
|
Specifies the connect string to connect to the directory database. This argument is mandatory. See Also: Oracle9i Net Services Administrator's Guide in the Oracle Database Documentation Library |
|
Specifies the base DN of the subtree to be deleted. This argument is mandatory. |
|
Specifies the number of entries to be committed as a part of one transaction. |
|
Specifies native character set encoding. See Also: Chapter G, "Globalization Support in the Directory". |
The bulkload command-line tool is useful for loading large number of entries to a directory server. It uses Oracle SQL*Loader to load directory entries. The bulkload tool expects the input file to be in LDIF.
See Also:
|
The bulkload tool performs its operation in following phases:
In the check phase, all entries of LDIF files are verified for valid LDAP schema and duplicate entries. If there are any errors reported by bulkloader, then the user needs to rectify the error and retry bulkload.
In the generate phase, the LDIF input is converted into intermediate files that can be used by SQL*Loader to load the data into the Oracle Internet Directory directory store.
The Intermediate files generated in generate phase are loaded into the Oracle9i Database Server which is the Oracle Internet Directory directory store. Bulkloader supports two types of loading of data:
In incremental mode, you can append data to existing directory data. It should be used when you want to append a small amount of data. It is faster than other "add" methods, but slower than bulk mode loading. In this mode, Bulkloader does not drop and rebuild catalog indexes. Instead, it uses SQL*Loader in insert mode to add data to the database and update indexes through inserts.
Here, "small amount" is a relative number, it really depends upon existing data in directory as well amount of data to be loaded and the hardware capabilities to handle the load.
To invoke incremental mode, user need to specify -append along with other options.
It is important to note that when using bulkload in incremental mode, one must put the directory server in read-modify mode. During read-modify mode, search and modify operations are allowed but add, delete, and modifyDN operations are restricted.
See Also:
"Task 2: Configure Structural Access Items" for instructions on using Oracle Directory Manager to set access rights |
In bulk mode, you must be able to add or append large number of entries to a directory. By default, Bulkloader runs in bulk mode. Bulk mode is faster than incremental mode.
In bulk mode, all Oracle Internet Directory server instances should be stopped. In this mode, Bulkloader drops existing indexes and recreates them after loading of data. For data loading, it uses SQL*Loader direct-path mode.
tiAfter the load is complete, the indexes are recreated if the load was done in "bulk" mode. Also, the Bulkloader tool provides an option just to recreate all indexes. This is useful in case if previous index creation was unsuccessful for some reason.
A failure in the 'load' phase of bulkload operation can leave directory data in inconsistent state. Bulkloader can revert back to original state that existed prior to the invocation of bulkload. Use the -recover option to recover directory data in case of Bulkload failure.
The bulkload tool can be used in single node as well as multiple node environments.
The typical usage scenario is to load directory data after Oracle Internet Directory installation. One would want to 'check' the LDIF file for schema errors, 'generate' the intermediate files and 'load' the data into the Oracle Internet Directory directory store. The 'parallel' option is normally faster since the load and index creation happens in parallel. The invocation of bulkload will be something like:
bulkload.sh -connect <conn_str> -check -generate -load -parallel <LDIF>
One can break up the above operation one into separate 'check, 'generate' and 'load' invocations. The 'check' can also be avoided if the LDIF data is from another Oracle Internet Directory directory node.
If one needs to add directory entries to an Oracle Internet Directory directory store that already has some user LDIF data, then the 'incremental' or 'append' mode is the way to go. This mode is normally faster than other methods of adding entries to the directory. However, it must be ensured that the Oracle Internet Directory LDAP instances are in read-modify mode before bulkload begins to append data. The typical invocation of bulkload will be something like:
bulkload.sh -connect <conn_str> -check -generate -load -append <LDIF>
The bulkload operation will take care of either updating the indexes or creating the indexes. However, due to issues like improper sizing, it may so happen that the indexes may not be updated or created properly. Bulkloader provides an option to recreate all the indexes. The invocation of bulkload will be:
bulkload.sh -connect <conn_str> -index
Due to issues like improper disk sizing, the 'load' phase of bulkload may fail. If this happens, there are chances that the directory data is inconsistent and hence, bulkloader provides an option to recover the directory data to the state that existed prior to the invocation of bulkload:
bulkload.sh -connect <conn_str> -recover
One must specify the connect strings of all the Oracle Internet Directory nodes involved. The bulkload will be invoked something like:
bulkload.sh -connect "<conn_str1> <conn_str2> <conn_str3>" -check -generate -load -parallel <LDIF>
The bulkloader will handle this as given below:
Here, the approach is the same as in the bulk mode loading except that the Oracle Internet Directory LDAP servers need not be shutdown, rather all of them need to be in 'read-only' mode.
In multi-node environments, it is the directory administrator's responsibility to make sure that all nodes have same schema before running bulkloader.
If the user sees bad entries logged in badentry.ldif but does not rectify the entries, then data can be inconsistent.
The 'check' mode of bulkloader does not check and report the lack of parent/child relationships between entries.
The 'incremental' or 'append' mode is only for adding new entries not new attribute values to existing entries.
In multi-node environments, the first connect string specified must refer to the local node.
The bulkload tool uses this syntax:
bulkload.sh -connect connect_string <[-check] [-generate] [-restore] [-numThread] [-parallel] [-encode] [-append] [-load] | [-index] | [-recover] absolute_path_to_LDIF_data_file
Table A-17 lists and describes the arguments.
Argument | Description | Mandatory? |
---|---|---|
|
Specifies the net service name defined in the See Also: Oracle9i Net Services Administrator's Guide in the Oracle9i Database Server Documentation Library |
Yes |
|
Checks LDAP schema for inconsistencies and for existence of duplicate DNs in the file |
No |
|
Creates intermediate files suitable for loading into Oracle Internet Directory using SQL*Loader |
No |
|
Assumes operational attributes, such as |
No |
|
Specifies the number of threads to be created. - numThread is useful only in -generate mode. The default value is number of CPUs on machine + 1 |
No |
|
Specifies that the loading should be done in parallel. Useful with -load option |
No |
|
Specifies native character set encoding See Also: Chapter G, "Globalization Support in the Directory" |
No |
|
Specifies append incremental mode (Default is bulkmode append) |
No |
|
Loads files resulting from generate phase into specified database |
No |
|
Recreates indexes on all catalog tables |
No |
|
In case of bulkload.sh failure, recovers directory with original data |
No |
-file_name |
Absolute path of ldif file |
No |
The LDIF data file path must be fully specified for check or generate operations.
While calling bulkload at least one of -check
, -generate
, -load
, -recover
or -index
actions must be specified.
There are certain combinations of options that should be called together for effective bulkloading.
orclguid
, creatorsname
, and so forth.
-generate
actions.
-numThread
is useful only if given with -generate option.
-parallel
should be called with -load
only.
-recover
or -index
should not be specified with any other option.
After generating a file with the generate
option, you can use the load
option to load multiple computers with the identical SQL*Loader file. Do this only when creating a new replica node.
When you load the same data into multiple nodes in a replicated network, ensure that the orclGUID
parameter (global IDs) is consistent across all the nodes. You can accomplish this by generating the bulkload data file once only (using the -generate
option), and then using the same data file to load the other nodes (using the -load
option).
The bulkmodify command-line tool enables you to modify a large number of existing entries in an efficient way. The bulkmodify tool supports the following:
objectclass=*
, objectclass=oneclass
, or telephonenumber=*
.
The bulkmodify tool performs schema checking on the specified attribute name and value pair during initialization. All entries that meet the following criteria are modified:
The Oracle directory server and Oracle directory replication server may be running concurrently while bulk modification is in progress, but the bulk modification does not affect the replication server. You must perform bulk modification against all replicas.
You must restrict user access to the subtree during bulk modification. If necessary, ACI restriction can be applied to the subtree being updated by bulkmodify.
You cannot use bulkmodify to add a value to single-valued attributes that already contain one value. If a second value is added, you must alter the directory schema to make that attribute multi-valued.
The bulkmodify tool uses this syntax:
bulkmodify -c connect_string -b "base_dn" {-a|-r} attr_name -v att_value [-f filter] [-s size]
Argument | Description |
---|---|
|
Specifies the connect string for the directory database. This argument is mandatory. See Also: Oracle9i Net Services Administrator's Guide in the Oracle Database Documentation Library |
|
Specifies the base DN of the subtree to be modified. This argument is mandatory. |
|
Specifies the attribute name for addition. This argument is mandatory. |
|
Specifies the attribute name for replacement. This argument is mandatory. |
|
Specifies the attribute value for either addition or replacement. This argument is mandatory. |
|
Specifies the filter to be used |
|
Specifies the number of entries to be committed as a part of one transaction. If not specified, default is 100. |
|
Specifies native character set encoding. See Chapter G, "Globalization Support in the Directory". |
The filter specified with the -f
option must contain a single attribute.
If a filter is not specified, the default filter objectclass=*
is assumed.
There can be only one attribute name specified in the -a or -r
option in each execution.
There can be only one value specified in the -v
option in each execution. For example, the following bulkmodify command adds the telephone number 408-123-4567 to the entries of all employees who have Anne Smith as their manager:
bulkmodify -c my_database -b "c=US" -a telephoneNumber -v "408-123-4567" -f "manager=Anne Smith"
To assure that the modified entries are read, after completing the bulkmodify procedure, restart the Oracle Internet Directory server.
The ldifwrite command-line tool enables you to convert to LDIF all or part of the information residing in an Oracle Internet Directory. This makes that information available for loading into a new node in a replicated directory or into another node for backup storage.
The ldifwrite tool performs a subtree search, including all entries below the specified DN, including the DN itself.
The ldifwrite tool uses this syntax:
ldifwrite -c connect_string -b "base_DN" -f file_name
This example writes all the entries under ou=Europe, o=imc, c=us
into the output1.ldi
file.
ldifwrite -c nldap -b "ou=Europe, o=imc, c=us" -f output1.ldi
All the arguments are mandatory.
The LDIF file and the intermediate file are always written to the current directory.
The ldifwrite tool includes the operational attributes of each entry in the directory, including createtimestamp
, creatorsname
, and orclguid
.
When prompted for the Oracle Internet Directory password, enter the password of the underlying ODS user. The default password is ods
.
This example uses the following naming context objects defined in partial replication:
dn: cn=includednamingcontext000001,
cn=replication namecontext,
orclagreementid=000001,
orclreplicaid=node replica identifier,
cn=replication configuration orclincludednamingcontexts: c=us orclexcludednamingcontexts: ou=Americas, c=us orclexcludedattributes: userpassword objectclass: top objectclass: orclreplnamectxconfig
In this example, all entries under c=us
are backed up except ou=Americas,c=us
. The userpassword
attribute is also excluded. The command is
ldifwrite -c connect string -b "cn=includednamingcontext000001,cn=replication namecontext,orclagreementid=000001,orclreplicaid=node replica identifier,cn=replication configuration" -f file name
|
![]() Copyright © 1999, 2003 Oracle Corporation. All Rights Reserved. |
|