Procedure of shrinking DB log file (transaction log file).
In SQL Server Management Studio
Right click on a DB, Properties -> Options-> Recovery model -> change from 'Full' to 'Simple' -> OK
Right click on a DB -> Tasks -> Shrink -> Files -> File type -> Log -> OK
The shrinking procedure should not take more than 3 s. It is not possible to change DB Recovery mode this way if a mirroring is setup.
Now, some rules of shrinking and maintaining log file.
-
By default Recovery model is set to FULL
-
If you store in a DB crucial/important information, then recovery model should be set to FULL
-
If recovery model is set to FULL, it means that there should be a backup in place, a backup that also includes a transaction log file
-
When a backup for a transaction log file runs, the transaction log file is shrink. The truncation occurs after a Checkpoint process
-
So if your transaction log is big, like 7 GB, it means that you:
-
Don't have a backup that includes transaction log fie. And it means that you don't need FULL recovery mode
-
Your backup is not working
-
You have a big and heavily used database
No comments:
Post a Comment