Ad Practice 7: offline fragmentation

Source: Internet
Author: User

This article from the "yue lei's Microsoft Network Classroom" blog, please be sure to keep this source http://yuelei.blog.51cto.com/202879/123829

 

Active Directory is a non-relational database designed for query. After using active directory for a period of time, you need to maintain the database content to reduce data fragmentation and improve query efficiency, today, we will introduce how to maintain the Active Directory database offline.

When active directory is created, the default database and transaction log storage path is C:/Windows/NTDs. We open the domain controller Florence created in the previous article and locate C: in the/Windows/NTDs directory, let's take a look at the functions of each file. Among them, NTDs. Dit is the database file of Active Directory, and EDB. log is the transaction log file. The transaction log file records the changes in the database content, which is very important. The default transaction log file size is only 10 MB. If the transaction log file is full, the system automatically generates edb00001.log to continue storing the transaction log. If edb00001.log is full, edb1_2.log is generated next, and so on. By the way, in the production environment, we should store database files and Transaction files separately, which can improve performance and increase data security, however, win2003 requires that the database and transaction logs of Active Directory be stored on the same hard disk, unlike the database and transaction logs of Active Directory in Win2000, they can be stored on different hard disks.

EDB. Chk is the checkpoint file of transaction logs. It records the differences between the active directory on the hard disk and the Active Directory in the memory. Generally, this file is used for the initialization or restoration of Active Directory. Res1.log and res2.log are the transaction log files retained by the system. These two files occupy 20 mb of space and are mainly used to reserve 20 mb of space for Active Directory transaction logs, to avoid shutdown when hard disk space is used up.

After using active directory for a period of time, data fragments are generated, which means that the space occupied by Active Directory increases and the response speed decreases. In this case, you need to fragment the Active Directory. Active Directory fragment is divided into online and offline parts. By default, online sorting is performed once every 12 hours. The advantage of online sorting is that you do not need to disable Active Directory during database maintenance and the user is not affected. The disadvantage is that online sorting can only be performed in the allocated database space, the space occupied by the database cannot be reduced. If the size of Active Directory is small and data changes are not frequent, we can use the default online sorting method. If the Active Directory database is large enough to reach the G scale and the data changes frequently, we will use the offline maintenance mentioned today. Offline maintenance requires offline processing of Active Directory, and then fragment of Active Directory. In this process, Active Directory cannot be used, and Ad-based business systems will be affected, therefore, it is recommended that you perform this operation at idle time, such as at night. After Active Directory performs offline fragment processing, it can effectively reduce the size of the active directory database and increase the query speed. Some units have gone through offline fragment processing in the Active Directory, the size of active directory can be reduced from 11 GB to 6 GB! Therefore, offline maintenance is necessary for organizations that frequently update Active Directory and contain massive data in Active Directory.

How can we perform offline fragmentation of Active Directory? We use the domain controller Florence as an example to demonstrate how to operate. First, we need to enter the Directory Service Restore Mode on Florence. In this mode, Active Directory will be suspended offline, then we can process the offline active directory database. As shown in, restart Florence and press F8 after the self-check to select "Directory Service Restore Mode ".

After entering the directory service recovery mode, we enter the command ntdsutil, as shown in, and we will use ntdsutil to fragment Active Directory.

As shown in, we enter files in ntdsutil.

As shown in the following figure, we enter compact to C:/, which means to clean up the fragments of the Active Directory database and compress them to the root directory of drive C, in this way, we will get an NTDs that eliminates the Active Directory fragments under the root directory of drive C. dit.

As shown in, you can find that esentutl.exe is the tool that truly compresses active directory. this tool will be frequently used in the future, and you will find similar tools in exchange, mainly because Active Directory, exchange, wins and other servers use similar non-relational database engines.

As shown in, after the compression is successful, we use the new NTDs. Dit to overwrite the original active directory database file and delete the original log file, but the EDB. Chk file is still retained.

As shown in, this is the active directory file after fragmentation. If the file is in a large network, it can be seen that the disk space is released after the offline sorting.

Offline fragment processing of Active Directory can only be performed on a single domain controller. Compression of Active Directory does not affect the existing data of active directory or the replication of Active Directory.

This article from the "yue lei's Microsoft Network Classroom" blog, please be sure to keep this source http://yuelei.blog.51cto.com/202879/123829

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.