Get Adobe Flash player

How to: Desfragmentação Offline do Active Directory

 

 

1 - Abrir um novo prompt de comando e executar os seguintes comandos.

 

C:\>D:
C:\>cd\
D:\mkdir D:\NTDS_New

OBS: Se esta pasta já existir devido a reparação anterior da base, copie o conteúdo para outro lugar e deixe a pasta vazia.


2 - Desativar serviço do AD



C:\>net stop ntds
The following services are dependent on the Active Directory Domain Service.
Stopping the Active Directory Domain Services service will also stop….
File Replication Service
Kerberos Key Distribution Center
Intersite Messaging
DNS Server
Do you want to continue this operation? (Y/N) [N]: y
The File Replication Service service is stopping...
The File Replication Service service was stopped successfully.
The Kerberos Key Distribution Center service was stopped successfully.
The Intersite Messaging service is stopping.
The Intersite Messaging service was stopped successfully.
The DNS Server service is stopping.
The DNS Server service was stopped successfully.
The Active Directory Domain Services service is stopping.
The Active Directory Domain Services service was stopped successfully.

 

2.1 Colocar o serviço Active Directory Domain Service como disable

 


… Seguir com os comandos:

C:\>ntdsutil

ntdsutil: list instance

Instance Name:          NTDS
LDAP Port:                 389
SSL Port:                    636
Install folder:               D:\NTDS
Database file:                         D:\NTDS\ntds.dit
Log folder:                  L:\NTDS
NTDS Mode :                         Active Directory Domain Controller Mode

ntdsutil: Activate Instance NTDS

Active instance set to "NTDS".
ntdsutil: files
file maintenance: info
Drive Information:
D:\ NTFS (Fixed Drive ) free(24.2 Gb) total(39.9 Gb)
DS Path Information:
Database : D:\NTDS\ntds.dit - 16.1 Mb
Backup dir : D:\NTDS\dsadata.bak
Working dir: D:\NTDS
Log dir : L:\NTDS - 40.0 Mb total
edbres00002.jrs - 10.0 Mb
edbres00001.jrs - 10.0 Mb
edb00001.log - 10.0 Mb
edb.log - 10.0 Mb

file maintenance: compact to D:\NTDS_New

Initiating DEFRAGMENTATION mode...
Source Database: D:\NTDS\ntds.dit
Target Database: D:\NTDS_New\ntds.dit
Defragmentation Status (% complete)
0 10 20 30 40 50 60 70 80 90 100
|----|----|----|----|----|----|----|----|----|----|
...................................................


Após finalizada a desfragmentação, vem a seguinte mensagem:

" It is recommended that you immediately perform a full backup of this database. If you restore a backup made before the defragmentation, the database will be rolled back to the state it was in at the time of that backup.

Compaction is successful. You need to:"

_____

Não Executar ainda copy "D:\NTDS_New\ntds.dit" "D:\NTDS\ntds.dit"

and delete the old log files:

Não Executar ainda del L:\NTDS\*.log

file maintenance:quit

>> quit

 

3 - Executar os comandos:

 

-     Gerar uma cópia da base antiga:

copy "D:\NTDS\ntds.dit" "D:\NTDS\ntds.dit_old"

 

-       Salvar os arquivos de logs:

copy “L:\NTDS\*.log” “D:\NTDS_New\”

 

-     Substituir a nova base:

copy "D:\NTDS_New\ntds.dit" "D:\NTDS\ntds.dit"

-     Deletar a antiga:

del L:\NTDS\*.log

 

----------------------------------------------

4 - Colocar o service Active Directory Domain Service como automatic

 

net start ntds

 

- DavidLago

Pesquisa / Search

David's Twitter

Visitors

21539
TodayToday23
YesterdayYesterday83
This WeekThis Week249
This MonthThis Month1630
All DaysAll Days21539

Who's Online

We have 4 guests online

Access Map