Optimize database searches by using the MMS Hash Configuration Utility!. Examining the MMS Database DB500.p DB500.lok DB500.dat DB500.ndx X500.db X500.db Make up the relational database
Trang 1Contents
Overview 1
Backing Up and Restoring the
Optimizing MMS Database Searches 8
Lab A: Maintaining the MMS Database 17
Distributing the Metadirectory Across
Trang 2to represent any real individual, company, product, or event, unless otherwise noted Complying with all applicable copyright laws is the responsibility of the user No part of this document may
be reproduced or transmitted in any form or by any means, electronic or mechanical, for any purpose, without the express written permission of Microsoft Corporation If, however, your only means of access is electronic, permission to print one copy is hereby granted
Microsoft may have patents, patent applications, trademarks, copyrights, or other intellectual property rights covering subject matter in this document Except as expressly provided in any written license agreement from Microsoft, the furnishing of this document does not give you any license to these patents, trademarks, copyrights, or other intellectual property
2000 Microsoft Corporation All rights reserved
Microsoft, BackOffice, MS-DOS, Windows, Windows NT, <plus other appropriate product names or titles The publications specialist replaces this example list with the list of trademarks provided by the copy editor Microsoft is listed first, followed by all other Microsoft trademarks
in alphabetical order > are either registered trademarks or trademarks of Microsoft Corporation
in the U.S.A and/or other countries
<The publications specialist inserts mention of specific, contractually obligated to, third-party trademarks, provided by the copy editor>
Other product and company names mentioned herein may be the trademarks of their respective owners
Trang 3Overview
! Examining the MMS Database
! Backing Up and Restoring the MMS Database
! Compacting the MMS Database
! Optimizing MMS Database Searches
! Distributing the Metadirectory Across Multiple MMS Servers
! Best Practices
After you have implemented Microsoft® Metadirectory Services (MMS) version 2.2 for your organization, there are a number of tasks that you should perform to maintain the functionality of the metadirectory These tasks include backing up and restoring the MMS database, and compacting the database to recover storage allocated to deleted records
It is also important to optimize MMS database searches from time to time to accommodate the modifications that occur to the information in the
metadirectory In addition, you can improve server and network performance by distributing the metadirectory across multiple MMS servers Understanding how to maintain and optimize MMS is essential to ensuring the ongoing functionality of the metadirectory
After completing this module, you will be able to:
! Describe the components of the MMS database
! Backup and restore the MMS database by using the MMS Online Backup Utility
! Maintain the MMS database by using the MMS Compaction Utility
! Optimize database searches by using the MMS Hash Configuration Utility
! Distribute the metadirectory across multiple MMS servers
! Describe best practices for maintaining and optimizing the MMS database
In this module, you will learn
about how to maintain and
optimize MMS
Trang 4Examining the MMS Database
DB500.p DB500.lok
DB500.dat DB500.ndx X500.db
X500.db
Make up the relational database component of the metadirectory and must always be stored in the same location
Make up the relational database component of the metadirectory and must always be stored in the same location
Contains the entire metadirectory ASN.1 database
Hash.db Contains the hashed index to the database that is used for searchingContains the hashed index to the database that is used for searching
VIATran.* Contain a transaction stack of operations performed on the database and its index filesContain a transaction stack of operations performed on the database and its index files
Before you begin to the tasks associated with maintaining and optimizing the MMS database, it is important to know about the structure and files that comprise the database The MMS database consists of the following files in the
\Zoomserv\Data\Db directory:
! DB500.p, DB500.lok, DB500.dat, and DB500.ndx These files comprise the
relational database component of the metadirectory and must always be stored in the same directory
! X500.db This file contains the entire metadirectory Abstract Syntax
Notation 1 (ASN.1) database The size of the X500.db file is limited to two gigabytes
! Hash.db This file contains the index that is used for searching the database
! Hashwild.db This file contains the wildcard search index, which enables
partial-word searches
! VIATran.* These files contain a “transaction stack” of operations
performed on the database and its index files
The \Zoomserv\Data\Db directory also contains a subdirectory, \Fileattr, which is designed to store the contents of files, such as Microsoft Word documents or Microsoft Excel spreadsheets, that are referenced in the MMS database The entire \Fileattr tree must be stored in one location, which cannot
be changed without reinitializing MMS
Typically, the MMS Server database files are all contained in the
\Zoomserv\Data\Db directory on the MMS server However, you can distribute the database files over multiple disks and multiple computers, for example if your MMS server has limited hard disk space
To store the database files in a location other than the \Zoomserv\Data\Db
Topic Objective
To identify the components
of the MMS database
Lead-in
The MMS database consists
of a set of files in the
\Zoomserv\Data\Db
directory
Note
Trang 5As installed, the DB5CFG file contains a series of lines that serve as placeholders for specifying the location of the MMS database components By default, these lines are commented out (the # sign indicates a comment) and the location of the MMS database is in the \Zoomserv\Data\Db directory If you move any of the database files, you must uncomment the appropriate line and provide a full path to the new location
The following table describes the lines in the DB5CFG file and the components associated with each line
Line Component
db5_rel_db_dir All four DB500 files
db5_asn_db_dir X500.db
db5_hash_db_dir Hash.db, Hashwild.db
db5_tran_db_dir VIATran.nn, VIATran.idx
db5_fileattr_dir \Fileattr directory
You must restart the MMS Server service before changes to the DB5CFG file take effect
Note
Trang 6Backing Up and Restoring the MMS Database
MMS Database
\zoomserv\data \Viabackup
Backup Write
Local Hard Disk
or Disk Storage
MMS includes the MMS Online Backup Utility, which you can use to make a copy of the MMS database and related files This utility copies the contents of the \Zoomserv\Data directory to a local hard disk or to disk storage accessible over the network
The MMS Online Backup Utility does not back up the
\Zoomserv\Data\logs directory because the contents of this directory are not essential to restoring the MMS database and because of the potential size of the log files In addition, you must also back up the contents of the \Zoomserv\Bin directory to be able to restore the MMS Server service fully
The MMS Online Backup Utility blocks modifications to the \Zoomserv directory while the utility is making backup copies All other MMS services (ldap and http requests) will remain active As a result, you can use the MMS Online Backup Utility regardless of whether the MMS Server service is running
in a \Viabackup subdirectory in the user's temp directory
Topic Objective
To describe how to back up
and restore the MMS
database
Lead-in
MMS includes the MMS
Online Backup Utility, which
you can use to make a copy
of the MMS database
Delivery Tip
Demonstrate the use of the
MMS Online Backup Utility
Note
Trang 7You can also run the MMS Online Backup Utility (viabackup.exe), which is located in the \Zoomserv\bin directory, from the command line When you run the MMS Online Backup Utility from the command line, you can include any
or all of the following switches:
! -path arg Specifies the directory location in which the backed up files are
placed For example:
viabackup.exe -path g:\MMS\backups
! -restore Restores the database from a set of backup files If you do not
specify a value for the –path switch, the utility uses the default backup location, which is the user's temp directory For example:
viabackup.exe -restore -path g:\MMS\backups
! -force Backs up or restores all files, regardless of timestamp If you do not
use this switch with the viabackup.exe command, the MMS Online Backup Utility performs incremental backups and restores
viabackup.exe -force
Scheduling the Operation of the MMS Online Backup Utility
You can schedule the operation of the MMS Online Backup Utility by typing
viabackup –path path (where path is the path to the destination of the back up
files) in the Command box in the Schedule dialog box associated with a
management agent
You can also schedule the operation of the MMS Online Backup Utility by using Scheduled Tasks in Control Panel in Microsoft Windows® 2000
Trang 8Compacting the MMS Database
3 Compact ASN database
4 Verify Meta-Directory links
5 Restart server when done
as a service
as a program Description This action will perform a verification of the ASN store (x500.db) and verify consistency between the relational index and the ASN store.
OK Cancel Apply Help
2 Verify ASN database
MMS includes the MMS Compaction Utility, which you use to maintain the integrity of the MMS database You can configure the MMS Compaction Utility to perform one or more of the following tasks:
! Verify ASN database Examines the MMS database for anomalies (such as
duplicate records that were created when a server crashed during a modify operation) and repairs them
! Compact ASN database Renames the existing MMS database file X500.db
to X500.sav Then, the MMS Compaction Utility copies active records to a new X500.db file, thereby recovering the space occupied by deleted records Finally, the utility rebuilds all index files, including the hashed database that
is used for searching
! Verify Meta-Directory links Checks and verifies all internal links between
directory entries
You must stop the MMS Server service before running the MMS Compaction Utility You can configure the utility to restart the MMS Server service automatically at the conclusion of the compaction process
Starting the MMS Compaction Utility You can launch the MMS Compaction Utility from the Start menu You can
also run the MMS Compaction Utility (viacompact.exe), which is located in the
\Zoomserv\bin directory, from the command line
When you run the MMS Compaction Utility from the command line, you cannot specify any advanced configuration options; therefore, the utility performs by using default parameters
Topic Objective
To identify the topics
associated with using the
MMS Compaction Utility
Lead-in
MMS includes the MMS
Compaction Utility, which
you can use to maintain the
Trang 9When you run the MMS Compaction Utility from the command line, you can specify one or both of the following switches:
! -unattended Runs the MMS Compaction Utility in unattended mode No
message boxes appear and all prompts receive a Yes reply
! -start Starts the MMS Compaction Utility immediately
When you run the MMS Compaction Utility, the MMS Compaction Utility
dialog box appears The following table describes the buttons available in the
MMS Compaction Utility dialog box
Button Description
Start Starts the compaction process
View Logs Displays the logs associated with the
operation of the MMS Compaction Utility
Advanced Displays the Options dialog box, which
you use to specify which of the functions you want the utility to perform
Exit Closes the MMS Compaction Utility
The MMS Compaction Utility dialog box also contains a Status Message section When you run the MMS Compaction Utility, the Status Message
section displays messages that allow you to follow the progress of the compaction operation and to note any error conditions
At the bottom of the MMS Compaction Utility dialog box are two status bars
One bar displays the status of the current operation The second bar displays the status of the entire process
Scheduling the Operation of the MMS Compaction Utility
You can schedule the operation of the MMS Compaction Utility by creating a
batch file designed to stop the MMS Server service, run the viacompact – unattended –start command, and then restart the MMS Server service You would specify the batch file to run in the Schedule dialog box for a
management agent
You can also schedule the batch file to run by using Scheduled Tasks in Control Panel in Windows 2000
Trang 10# Optimizing MMS Database Searches
! Introduction to Indexing in MMS
! Indexing Attributes by Configuring Hash Types
! Indexing Attributes for Wildcard Searches
! Tuning Hashing Parameters Using the MMS Hash Configuration Utility
With a default installation of MMS, you can search for entries in the MMS database based on selected attributes in the metadirectory However, depending
on the type of information that your organization needs to search for on a regular basis, you may want to index additional attributes to increase search efficiency You can also index attributes for wildcard searches
In MMS, search functionality is implemented through the use of a series of indexes MMS provides the MMS Hash Configuration Utility to help you make your indexing as efficient and useful as possible
Topic Objective
To describe the topics
associated with optimizing
MMS database searches
Lead-in
With a default installation of
MMS, you can search for
entries based on selected
attributes in the
metadirectory
Trang 11$ Phone number (telephoneNumber)
$ Given name (givenName)
$ SMTP address (mail)
! When Deciding Which Additional Attributes to Index, Carefully Weigh the Costs and Benefits of Resource Allocation Versus the Efficiency of the Search
MMS indexes are implemented by using hashing Hashing consists of applying
a mathematical function to a piece of data to produce a number, or key, within a fixed range Hashing is widely used to produce indexes that permit rapid retrieval of specific records in a file or database
The MMS database is initialized with a number of hashed attributes, including:
! Common name (cn)
! User ID (uid)
! Surname (sn)
! Phone number (telephoneNumber)
! Given name (givenName)
! Simple Mail Transfer Protocol (SMTP) address (mail)
For more information about hashing, see Appendix B, “Attribute
Hashing and Searching,” in the MMS System Administration Manual
When you search the metadirectory, the MMS server initially determines if the attribute that you want to search on is included in the MMS hash tables If the attribute is included, the MMS server performs the search by using the information in the index If the attribute is not included, the MMS server must scan each entry below the search base to provide accurate search results
Topic Objective
To introduce the basic
concepts related to indexing
function to a piece of data,
thereby producing a number
within a fixed range
Note
Trang 12Searching on non-indexed attributes can be time-intensive and intensive Similarly, creating a complex hash table by indexing every attribute and hashing every record that is written to the MMS database can also be very time-intensive and resource-intensive In deciding which attributes to index, consider the costs and benefits of resource allocation versus search efficiency
resource-When performing a search by using MMS Compass, you can search only
on indexed attributes By default, MMS searches on every indexed attribute
Note
Trang 13Indexing Attributes by Configuring Hash Types
OK Cancel
Hashing and Encryption
Hashing and encryption capabilities are grouped in this help topic because they are mutually exclusive for security reasons.
Hashing Guidelines
Hashing provides extremely fast access to directory objects with attributes of a given value or type When you are deciding whether or not to hash an attribute, you need to consider the relative uniqueness of the attribute’s values.
You can index additional attributes to optimize search performance When you index an attribute, you must specify a hash type for that attribute You
determine the appropriate hash type for an attribute based on how a user will search for the values of that attribute For example, if you want a search for the string “mary” to return “Mary Jane”, then the hash type must ignore case and match on any word in a value
You enable hashed searching on attribute values in existing entries in one of the following ways:
! Regenerate the hash databases by using the MMS Hash Configuration Utility The utility creates the new databases and gives them a tmp extension Stop the MMS Server service, rename the files, and then restart the service
! Configure attribute flow on a specific attribute and have the management agent re-write the value so it will get hashed, and then disable attribute flow
on each value when the process is complete
! Stop the MMS Server service, rebuild the MMS database by using the MMS Compaction Utility, and then restart the service This process may take a while to complete
When you index an
attribute, you must specify a
hash type for that attribute
Delivery Tip
Demonstrate how to index
attributes by configuring
hash types
Trang 14Each word is hashed separately, after being converted, or normalized, to uppercase For example, the common name (cn) attribute is indexed with the Caseless Word hash type to enable searches on any part of the name Because the values are normalized to uppercase, searches are case-independent
Caseless Exact
When you specify the Caseless Exact hash type for an attribute, MMS takes the value as a whole, including blanks and special characters, and normalizes the value to uppercase before hashing For example, to search for an organization called Northwest Traders, you could enter “Northwest Traders” or “northwest traders”, but a search on only “Northwest” would fail
Binary Value
When you specify the Binary Value hash type for an attribute, MMS takes the value as a whole, but without normalization Searches on an attribute
configured with the binary value hash type are case-sensitive Searching on
“Mary Jane” and “mary jane” produces entirely different results, as does a search on “Mary” With binary-value hashing, variations of essentially the same data are hashed as separate keys The greater number of hashed key requires a corresponding increase in the resources required to find a specific value Use this hash type if case sensitivity is important
Attribute Type
When you specify the Attribute Type hash type for an attribute, MMS takes the name of the attribute rather than its value This feature is used internally to search for entries that contain a certain attribute
Configuring Hash Types
To configure a hash type for an attribute, perform the following steps:
1 In the directory pane of MMS Compass, navigate to and select the entry for the attribute you want to configure for hashing
2 Right-click the entry for the attribute, and then click Properties
3 In the Attribute Properties dialog box for the attribute, display the Hashing tab
4 Under Hashing and Encryption, select the appropriate hash type
Trang 15Indexing Attributes for Wildcard Searches
! When Indexing Attributes for Wildcard Searches:
$ Avoid using attributes whose values are typically larger that one-two dozen characters
$ Avoid hashing attributes that are likely to have the same value for many records.
$ Avoid using multivalued attributes for wildcard hashing
When you search the metadirectory for entries, you can use wildcard characters
in the search string A wildcard character is a keyboard character that can be
used to represent one or many characters For example, the asterisk (*) typically represents one or more characters, and the question mark (?) typically
represents a single character In MMS, wildcard search strings must contain at least three alphabetic characters
Wildcard searches are supported through a special wildcard table that is built for attributes that you mark for wildcard searching
By default, MMS does not mark any attributes for wildcard searching, and the wildcard hash index file, Hashwild.db, is empty
When you mark an attribute for wildcard searching, you ensure that values for that attribute are added to the wildcard table These values are added when a directory entry containing that attribute value is written to or deleted from the MMS database
To enable wildcard searching on attribute values in existing entries, you must rebuild the MMS database by using the MMS Compaction Utility
The wildcard table is very complex and expensive to maintain As a result, it is recommended that you limit the number of attributes enabled for wildcard hashing In addition, when you consider indexing attributes for wildcard searches, keep the following points in mind:
! Avoid using attributes whose values are typically larger than 12 to 24 characters
! Avoid hashing attributes that are likely to have the same value for many records
Topic Objective
To identify how to index
attributes for wildcard
searching
Lead-in
When you search the
metadirectory for entries,
you can use wildcard
characters in the search
string A wildcard character
is a keyboard character that
can be used to represent
one or many characters
Delivery Tip
Demonstrate how to index
attributes for wildcard
searching
Note
Important
Trang 16Wildcard searches are limited to the metaverse because entries below the MMS Server entry in the directory tree are not indexed
To mark an attribute for wildcard searching, perform the following steps:
1 In the directory pane of MMS Compass, navigate to and select the entry for the attribute you want to configure for wildcard searching
2 Right-click the entry for the attribute, and then click Properties
3 In the Attribute Properties dialog box for the attribute, on the Hashing tab, under Hashing and Encryption, select the Allow wildcard search
check box