MS SQL Server Transaction Log truncation 事務日誌截斷

可參考微軟官網介紹:http://technet.microsoft.com/en-us/library/ms190925.aspx


SQL Server數據庫中,一個數據庫都是有數據文件(MDF文件)和日誌文件(LDF文件)組成的物理結構。


日誌截取的空餘空間可以被事務日誌重新使用。

Log truncation is essential to keep the log from filling. (日誌截取是防止log文件被填滿。)

Log truncation deletes inactive virtual log files from the logical transaction log of a SQL Server database, freeing space in the logical log for reuse by the Physical transaction log. (日誌截取刪除數據庫邏輯事務日誌中的inactive的日誌文件,邏輯日誌文件中的空餘空間會被物理事務日誌重利用。)


如果日誌文件不被截取,那麼它會一直增長,知道磁盤被佔滿。


爲了避免磁盤被佔滿,經過以下這兩個情況的日誌都會被截斷,除非截斷被延遲:

  • Under the simple recovery model, after a checkpoint.

    (數據庫處於simple模式,在checkpoint後會被截斷;)

  • Under the full recovery model or bulk-logged recovery model, if a checkpoint has occurred since the previous backup, truncation occurs after a log backup (unless it is a copy-only log backup).


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章