Exit Print View

Sun OpenDS Standard Edition 2.0 Administration Guide

Get PDF Book Print View
 

Document Information

Configuring the Directory Server

Configuring Security in the Directory Server

Managing Directory Data

Importing and Exporting Data

Populating a Stand-Alone Directory Server With Data

Importing Data Using import-ldif

To Import Data in Offline Mode

To Replace Existing Data During an Offline Import

To Append Imported Data to Existing Data

To Import Fractional Files

To Import Fractional Files by Using Filters

To Include or Exclude Attributes During Import

To Import a Compressed LDIF File

To Record Rejected or Skipped Entries During Import

To Import Data From a MakeLDIF Template

To Run an Import in Online Mode

To Schedule an Import

Exporting Data Using export-ldif

To Export Data to LDIF

To Export Partial Data

To Export Part of a Back End by Using Filters

To Include or Exclude Attributes During Export

To Export to LDIF and Then Compress the File

To Run an Export in Online Mode

To Schedule an Export

Importing and Exporting Entries With the Control Panel

To Import Entries With the Control Panel

To Export Entries to an LDIF File With the Control Panel

Creating MakeLDIF Template Files

The Template File Format

make-ldif Template File Tags

Defining Custom Tags

Backing Up and Restoring Data

Overview of the Backup and Restore Process

Backing Up Data

To Back Up All Back Ends

To Back Up All Back Ends with Encryption and Signed Hashes

To Perform an Incremental Backup on All Back Ends

To Back Up a Specific Back End

To Perform an Incremental Backup on a Specific Back End

To Schedule a Backup as a Task

Backing Up the Server Configuration

Backing Up for Disaster Recovery

To Back Up the Directory Server For Disaster Recovery

Restoring Data

To Restore a Back End

To Restore a Back End From Incremental Backups

To Schedule a Restore as a Task

To Restore the Configuration File

To Restore a Directory Server During Disaster Recovery

Restoring Replicated Directory Servers

Backing Up and Restoring Directory Data With the Control Panel

To Back Up Data With the Control Panel

To Restore Data With the Control Panel

Searching Directory Data

Overview of the ldapsearch Command

ldapsearch Location and Format

Understanding Search Criteria

ldapsearch Examples

To Return All Entries

To Search For a Specific User

To Search for Specific User Attributes

To Perform a Search With Base Scope

To Perform a Search With One-Level Scope

To Perform a Search With Subtree Scope

To Return Attribute Names Only

To Return User Attributes Only

To Return Base DNs Only

To Search For Specific Object Classes

To Return a Count of All Entries in the Directory

To Perform a Search With a Compound Filter

To Perform a Search Using a Filter File

To Limit the Number of Entries Returned in a Search

Using Advanced Search Features

Searching for Special Entries and Attributes

To Search for Operational Attributes

To Search the Root DSE Entry

To Search for ACI Attributes

To Search the Schema Entry

To Search the Configuration Entry

To Search the Monitoring Entry

Searching Over SSL

To Search Over SSL With Blind Trust

To Search Over SSL Using a Trust Store

To Search Over SSL With No Trust Store

To Search Over SSL Using a Keystore

To Search Using StartTLS

To Search Using SASL With DIGEST-MD5 Client Authentication

To Search Using SASL With the GSSAPI Mechanism

To Search Using SASL With the PLAIN Mechanism

Searching Using Controls

To View the Available Controls

To Search Using the Account Usability Request Control

To Search Using the Authorization Identity Request Control

To Search Using the Get Effective Rights Control

To Search Using the LDAP Assertion Control

To Search Using the LDAP Subentry Control

To Search Using the Manage DSA IT Control

To Search Using the Matched Values Filter Control

To Search Using the Password Policy Control

To Search Using the Persistent Search Control

To Search Using the Proxied Authorization Control

To Search Using the Server-Side Sort Control

To Search Using the Simple Paged Results Control

Searching Using the Virtual List View Control

To Search Using the Virtual List View Control

To Search Using Virtual List View With a Specific Target

To Search Using Virtual List View With a Known Total

Searching in Verbose Mode and With a Properties File

To Search in Verbose Mode

To Search Using a Properties File

Searching Internationalized Entries

Adding, Modifying, and Deleting Directory Data

Adding Directory Entries

To Create a Root Entry

To Add an Entry Using the --defaultAdd Option With ldapmodify

To Add Entries Using an LDIF Update Statement With ldapmodify

Adding Attributes

To Add an Attribute to an Entry

To Add an ACI Attribute

To Add an International Attribute

Modifying Directory Entries

To Modify an Attribute Value

To Modify an Attribute With Before and After Snapshots

To Delete an Attribute

To Change an RDN

To Move an Entry

Deleting Directory Entries

To Delete an Entry With ldapmodify

To Delete an Entry With ldapdelete

To Delete Multiple Entries by Using a DN File

Indexing Directory Data

Configuring Indexes on the Local DB Back End

To Create a New Local DB Index

Configuring VLV Indexes

To Create a New VLV Index

Managing Indexes With the Control Panel

To Display a List of Indexes

To Add an Index

To Add a VLV Index

To Delete an Index

To Verify Indexes

To Rebuild Indexes

Reducing Stored Data Size

To Enable or Disable Compact Encoding

To Enable or Disable Entry Compression

Managing Directory Data With the Control Panel

Managing Entries With the Control Panel

To Display A List of All Directory Entries

To Add a New Entry With the Control Panel

To Add a New Entry From an LDIF Specification With the Control Panel

To Change the Values of an Entry's Attributes With the Control Panel

To Delete an Entry With the Control Panel

Managing Base DNs With the Control Panel

Adding a New Base DN

Deleting a Base DN

Copying an Entry's DN to the Clipboard

Managing Users

To Reset a User's Password

To Create a Group

To Add a User to a Group

Deleting a Back End With the Control Panel

To Delete a Back End With the Control Panel

Selecting a View of Entry Data

To Select a View of Entry Data

Ensuring Attribute Value Uniqueness

Overview of the Unique Attribute Plug-In

Configuring the Unique Attribute Plug-In Using dsconfig

To Ensure Uniqueness of the Value of the uid Attribute

To Ensure Uniqueness of the Value of Any Other Attribute

Replication and the Unique Attribute Plug-In

Configuring Virtual Attributes

To List the Existing Virtual Attributes

To Create a New Virtual Attribute

To Enable or Disable a Virtual Attribute

To Display the Configuration of a Virtual Attribute

To Change the Configuration of a Virtual Attribute

Configuring Referrals

Configuring LDAP URLs

To Create a Referral

To Modify a Referral

To Delete a Referral

Controlling Access To Data

Replicating Data

Managing Users and Groups

Directory Server Monitoring

Improving Performance

Advanced Administration

Understanding Search Criteria

The ldapsearch command requires three sets of information to specify where and what to search in the directory information tree:

Specifying Filter Types and Operators

The directory server provides seven types of search filters, defined in the LDAP protocol. With each search filter type, you use operators that test the relationships between two entities, attribute and value.

The following table shows how search filters are used to return specific entries in a search query.

Search Filter
Operator
Description
Presence
attr=*
Return all entries that have any value associated with the specified attribute. The filter uses the wildcard character to denote zero or more characters in the string. For example, the following filter is common and returns all entries that have an object class with any value, which every entry has: (objectclass=\*).

Note - the LDAP protocol specifies that filters should have the form "(filter)", which includes parentheses surrounded by quotation marks. Although most directory servers accept filters without the parentheses and quotation marks, it is good practice to include them.


Equality
attr=value
Return entries containing attributes equal to a specified value. For example: (sn=Bergin) returns all entries that have a surname (sn) attribute with the value of Bergin.

Note - The sn value is case insensitive, so entries associated with sn=bergin or sn=Bergin will be returned.


Substring
attr=<initial-string><any substring><final-string>
Return entries with attributes containing a specified substring or partial substring. The filter uses the wildcard character to denote zero or more characters in the string.
  • Run an initial substring search that looks for all attribute values that have the characters Ber at the start of the string: (sn=Ber\*)

  • Specify the middle substring of an attribute value. For example: (sn=\*erg\*)

  • Specify the end of a substring of an attribute value. For example: (sn=\*gin). Or you can specify some combination of substrings

  • Specify the initial and middle substring: (sn=ber\*gi\*)

  • Specify the initial and ending substrings: (sn=be\*in)

  • Specify the middle and end substrings: (sn=\*er\*in)


    Note - Substring filters do not use true wild cards such as in system listings or regular expressions. Thus, the following filter would be invalid because of too many criteria: (sn=\*B\*rg\*n).


Greater than or equal to
attr>=value
Return entries containing attributes that are greater than or equal to the specified value. For example, (sn>=Bergin) returns all entries that have an attribute greater than or equal to the value, Bergin, based on the matching rules for attributes (see Understanding Matching Rules in Sun OpenDS Standard Edition 2.0 Architectural Reference).
Less than or equal to
attr<=value
Return entries containing attributes that are less than or equal to the specified value. For example, (sn&lt;=Bergin) returns all entries that have an attribute less than or equal to the value, Bergin, based on the matching rules for attributes.
Approximate
attr~=value
Return entries containing the specified attribute with a value that is approximately equal to the value specified in the search filter. For example: (sn~=Bergan) could return the entry associated with (sn=Bergin) or (sn=Bergan). The Approximate search filter works only with English language strings. It does not work with non-ASCII-based strings, such as Ja or Zn.
Extensible match
attr= attr [":dn"] [":" matchingrule] ":=" value Or:[:dn] ":" matchingrule ":=" value
Return the results entries when an attribute equals the value with the specified matching rule. LDAP version 3 enables you to build match operators and rules for a particular attribute. Matching rules define how to compare attribute values with a particular syntax. In other words, an extensible search filter enables you to add a matching rule to a search filter. For example, the following search filter compares entries containing the surname attribute with value equal to "Jensen" by using the matching rule designated by OID 2.5.13.5: (sn:2.5.13.5:=Jensen). Another example illustrates the use of the ":dn" notation to indicate that the OID 2.5.13.5 should be used when making comparisons, and that the attributes of an entry should be considered part of the entry when evaluating the match:(sn:dn:2.5.13.5:=Jensen)
Using Compound Search Filters

Multiple search filter components can be combined and evaluated by using the operator:

(Boolean-Operator(filter)(filter)(filter))

Boolean operators can be combined and nested together to form complex expressions:

(Boolean-Operator(filter)(Boolean-operator(filter)(filter)))

The following table describes the Boolean operators.

Search Filter
Operator
Description
AND
(&(filter)(filter))
All specified filters must be true for the statement to be true. For example, (&(sn=Carter)(l=Cupertino)) returns all entries that have the surname attribute equal to "Carter" and the location attribute equal to Cupertino if any.
OR
(|(filter)(filter))
At least one specified filter must be true for the statement to be true. For example, (|(sn=Carter)(l=Cupertino)) returns all entries that have the surname attribute equal to "Carter" or the location attribute equal to Cupertino if any.
NOT
(!(filter)(filter))
The specified filter must not be true for the statement to be true. For example, (!(sn=Bergin)) returns all entries that do not have a surname attribute equal to the string Smith. The filter also returns all entries that do not have the sn attribute.
Using UTF-8 Encoding in Search Filters

UTF8 is a byte-order, variable-length character code for Unicode and a subset of ASCII. You use UTF-8 for multiple-language support by replacing each character of a non 7-bit ASCII character with a byte of a UTF-8 encoding. Typically, you must escape the UTF-8 encoding with a backslash.

For example, the character é has a UTF-8 representation of c3a9 and è has a UTF-8 representation c3a8. A UTF-8 encoding is represented with an escaped backslash. So, é is represented as \\c3\\a9 and è is represented as \\c3\\a8. To represent cn=Hélène Laurent, you would use the following encoding:

(cn=H\\c3\\a9l\\c3\\a8ne Laurent)
Using Special Characters in Search Filters

You must specify special characters (for example, a space, backslash, asterisk, comma, period, or others) by using the escape backslash.