AD數(shù)據(jù)庫要減肥
由于AD數(shù)據(jù)庫的肥碩,導(dǎo)致辦公速率有所降低,所以就需要壓縮AD數(shù)據(jù)庫來提高DC的在AD讀寫方面的性能.
因?yàn)椴僮鰽D數(shù)據(jù)庫是比較危險(xiǎn)的動(dòng)作,因此在壓縮AD數(shù)據(jù)庫前,為安全起見請備份好系統(tǒng)狀態(tài)數(shù)據(jù)以備不時(shí)之需.
操作過程:
1.重新啟動(dòng)DC.
2.使用目錄服務(wù)恢復(fù)模式啟動(dòng)機(jī)器.
3.開啟命令行模式.
4.啟動(dòng)NTDS軟件:ntdsutil.exe
5.在ntdsutil提示符下輸入"files".如下:
ntdsutil:files
6.使用Compact to %s 命令壓縮數(shù)據(jù)庫.
因?yàn)锳D數(shù)據(jù)庫NTDS.dit存放在C:\WINNT\NTDS下,因此不能將數(shù)據(jù)庫直接壓縮在C:\WINNT\NTDS下,應(yīng)該壓縮到另外一個(gè)目錄中.
7.壓縮完畢,將壓縮了的ntds.dit拷回到C:\WINNT\NTDS下覆蓋原來的ntds.dit,并將C:\WINNT\NTDS下的所有.log文件刪除.
8.使用quit命令退出ntdsutil軟件.
9.重新啟動(dòng)DC,以普通模式進(jìn)入系統(tǒng).
一個(gè)簡單的例子:
file maintenance: Compact to e:\
打開數(shù)據(jù)庫 [Current]。
使用臨時(shí)路徑: E:\
執(zhí)行指令: C:\WINNT\system32\esentutl.exe /d "C:\WINNT\NTDS\ntds.dit" /8 /o /l"C:
\WINNT\NTDS" /s"C:\WINNT\NTDS" /t"e:\ntds.dit" /!10240 /p
Initiating DEFRAGMENTATION mode...
Database: C:\WINNT\NTDS\ntds.dit
Log files: C:\WINNT\NTDS
System files: C:\WINNT\NTDS
Temp. Database: e:\ntds.dit
Defragmentation Status ( % complete )
0 10 20 30 40 50 60 70 80 90 100
Note:
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.
Operation completed successfully in 17.314 seconds.
產(chǎn)生 Process Exit 碼 0x0(0)
如果壓縮成功您需要:
復(fù)制 "e:\ntds.dit" 到 "C:\WINNT\NTDS\ntds.dit"
并刪除舊的日志文件:
del C:\WINNT\NTDS\*.log
file maintenance:
在上面的例子中,我們將數(shù)據(jù)庫壓縮到了e:\下,這里注意,應(yīng)該使用e:\而不能使用e:做為路徑,否則會出錯(cuò).
ntdsutil.exe的file maintenance功能如下:
? 打印這個(gè)幫助信息
Compact to 將 DB 壓縮到指定的目錄
Header 轉(zhuǎn)儲 Jet 數(shù)據(jù)庫頭
Help 打印這個(gè)幫助信息
Info 返回有關(guān) DS 文件的信息
Integrity 執(zhí)行 Jet 功能檢查
Move DB to %s 將DB 移到指定的目錄
Move logs to %s 將日志移到指定的目錄
Quit 返回到上一個(gè)菜單
Recover 執(zhí)行軟數(shù)據(jù)庫故障恢復(fù)
Repair 執(zhí)行數(shù)據(jù)庫修復(fù) - 您可能會丟失數(shù)據(jù)
Set path backup %s 設(shè)置聯(lián)機(jī)備份目錄路徑
Set path DB %s 設(shè)置 DB 文件路徑
Set path logs %s 設(shè)置登錄目錄路徑
Set path working dir %s 設(shè)置 NTDS 工作目錄路徑
AD數(shù)據(jù)庫的“減肥計(jì)劃”就是這樣的,此時(shí)因?yàn)榛顒?dòng)目錄數(shù)據(jù)已經(jīng)是壓縮更新的了所以建議大家及時(shí)做好新的AD備份。1 O7 ^( q5 O u4 U( @7 x3 E
此時(shí)您的IT基礎(chǔ)架構(gòu)環(huán)境就可以飛奔如初了,DC也會感覺到自己走路輕了一些。(DC同志興奮的說:哈哈!減肥大成功!?。_@!!)
減肥是需要的,但平時(shí)鍛煉身體是必須的,基于AD的基礎(chǔ)架構(gòu)環(huán)境需要長期鍛煉才能強(qiáng)健如牛!您的收益也會走出一條如牛市股票般的曲線!
【編輯推薦】