Although the Active Directory database is automatically defragmented while it is running (known as online defragmentation), ...

Although the Active Directory database is automatically defragmented while it is running (known as online defragmentation), you can also stop Active Directory Domain Services to perform offline defragmentation to reduce its size further. Offline defragmentation also provides additional checks that can help ensure database integrity and performance.