How to compress the transaction logs

Gradually increase the size of the transaction log using SQL Server. Do notiong and become disk full. We need to complress the transaction log.

compress transaction log

check disk space for logfile

  1. Run Microsoft SQL Server Management Studio.
  2. Connect database.
  3. Select target database in object explorer.
  4. Select "compress" menu in "task" popup menu.


Open "File compress dialog", change to "log" in file type. The size of the log file is displayed at "The area currently allocated", and log space available is displayed at "space available".
In below figure, free disk space is 10MB, and free aloocated space is 0 MB. Log file is expanded when each log added.


Trancate the transaction log when backup transaction log.

Procedure of backup transaction log.

  1. Select database to backup in object explorer.
  2. Show popup menu by press down right mouse button. Click "backup" menu in "task" popup menu.


"Backup dialog" is displayed. Change to "Transaction log" at "backup type" combobox. Set backup file name.

Start backup to click "OK" button.

After backup, open "file compress dialog" to select "compress" menu in "task" menu. Check free space increase. Transaction log is truncated.

著者
iPentec Document 編集部
iPentec Document 編集部です。
快適な生活のための情報、価値のある体験やレビューを提供します。
最終更新日: 2017-07-29
作成日: 2011-11-11
iPentec all rights reserverd.