前言
今天登入 WUG 主控台發現 DB 滿了,頂到 SQL SERVER 2005 EXPRESS 的上限 4GB,
查了下官方文檔可以清除以下幾個 table 而不影響系統運作,所以在這邊留個操作記錄
操作
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
| C:\Users\Administrator>sqlcmd -E -S "%COMPUTERNAME%\WHATSUP"
truncate table WhatsUp.dbo.PassiveMonitorActivityLog; truncate table WhatsUp.dbo.StatisticalPing; truncate table WhatsUp.dbo.statisticalinterface; truncate table WhatsUp.dbo.statisticalpingpacketloss; truncate table WhatsUp.dbo.statisticalping; truncate table WhatsUp.dbo.statisticaldisk; truncate table WhatsUp.dbo.statisticalpingcache; truncate table WhatsUp.dbo.statisticalpingpacketlosscache; truncate table WhatsUp.dbo.activemonitorstatechangelog; truncate table WhatsUp.dbo.statisticalmemory; truncate table WhatsUp.dbo.statisticalnumeric; truncate table WhatsUp.dbo.actionactivitylog; truncate table WhatsUp.dbo.passivemonitoractivitylog; truncate table WhatsUp.dbo.generalerrorlog; GO
DBCC SHRINKDATABASE ('WhatsUp'); GO
|
執行完畢後從 4GB 縮到剩 1310 MB,減少了 68% 左右。
參考資料