徵狀
當您使用 Microsoft SQL Server 2012 或2014主版資料服務(MDS)時,歷程記錄可能會變得非常大,而且沒有內建的函數可供清理。 新增三個儲存程式,以清除分段、驗證及交易歷程記錄。 用法如下:
--@ModelID is the model ID that you clean up the log for.--@CLeanupOlderThanDate is the date before that the logs or records is deleted. DECLARE @CleanupOlderThanDate date = '<Date>', @ModelID INT = <ID>--Cleanup Transaction HistoryEXEC mdm.udpTransactionsCleanup @ModelID, @CleanupOlderThanDate; --Cleanup Validation HistoryEXEC mdm.udpValidationsCleanup @ModelID, @CleanupOlderThanDate; --Cleanup entity-based staging tableEXEC mdm.udpEntityStagingBatchTableCleanup @ModelID, @CleanupOlderThanDate;
注意: 增長較大的中央資料表是 tblTransaction、tblTransactionAnnotation、tblValidationLog、mdm. tblValidationHistory 和 mdm. tblStgBatch。
解決方案
此問題最初是在 SQL Server 的後續累積更新中修正。
SQL Server 2014 SP1 的累積更新1 /en-us/help/3067839
SQL Server 2012 SP2 累積更新6 /en-us/help/3052468
SQL Server 2014 累積更新7 /en-us/help/3046038
SQL Server 2012 SP1 累計更新15 /en-us/help/3038001
每個新的 SQL Server 累計更新都包含所有的修正程式,以及前一個累積更新中所包含的所有安全性修正程式。 查看 SQL Server 的最新累計更新:
狀態
Microsoft 已確認本篇文章<適用於>一節所列之 Microsoft 產品確實有上述問題。