Quantcast
Channel: How do you clear the SQL Server transaction log? - Stack Overflow
Viewing all articles
Browse latest Browse all 22

Answer by Mahendra for How do you clear the SQL Server transaction log?

$
0
0

It happened with me where the database log file was of 28 GBs.

What can you do to reduce this? Actually, log files are those file data which the SQL server keeps when an transaction has taken place. For a transaction to process SQL server allocates pages for the same. But after the completion of the transaction, these are not released suddenly hoping that there may be a transaction coming like the same one. This holds up the space.

Step 1: First Run this command in the database query explored checkpoint

Step 2: Right click on the database Task> Back upSelect back up type as Transaction LogAdd a destination address and file name to keep the backup data (.bak)

Repeat this step again and at this time give another file name

enter image description here

Step 3:Now go to the database Right-click on the database

Tasks> Shrinks> Files Choose File type as LogShrink action as release unused space

enter image description here

Step 4:

Check your log file normally in SQL 2014 this can be found at

C:\Program Files\Microsoft SQL Server\MSSQL12.MSSQL2014EXPRESS\MSSQL\DATA

In my case, its reduced from 28 GB to 1 MB


Viewing all articles
Browse latest Browse all 22

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>