You will now have a backup copy of the transaction log that you can move to another strorage device, and the original file will be truncated to the target size. Full recovery is recommended so that in the event of corruption or failure the database can be recovered to the very minute the database went down. Simple recovery will only allow you to recover the database to the last backup of the database.
Perform a checkpoint event in order for the log size to decrease you have to perform a checkpoint event, such as another full backup. JP83 great catch. Your comment is accurate, the model database is a template for all other databases.
My intention was to simplify things by not talking about the model database, because the model database in SQL server is set to FULL recovery by default, but to be more accurate I made a change to the wording above to reflect the information in your comment. Thanks for the feedback. Your goal with transaction log maintenance should be to maintain it a a reasonable size. How are we doing? Please help us improve Stack Overflow.
Take our short survey. Stack Overflow for Teams — Collaborate and share knowledge with a private group. Create a free Team What is Teams? Collectives on Stack Overflow. Learn more. SQL - shrink database log file Ask Question. Asked 11 years, 11 months ago. Active 4 years, 7 months ago. Viewed 4k times. I am trying to shrink my database log file. Am I missing something? Aaronaught k 24 24 gold badges silver badges bronze badges. As a general rule, shrinking your files is a bad idea.
Sorry, but I'm very new to this. Why is it a bad idea? It's a poor practice because it negates the purpose of the transaction log in the first place.
The best answers are voted up and rise to the top. Stack Overflow for Teams — Collaborate and share knowledge with a private group. Create a free Team What is Teams? Learn more. Ask Question. Asked 2 years, 10 months ago. Active 2 years, 10 months ago. Viewed times. Improve this question. Tony Hinkle 7, 1 1 gold badge 14 14 silver badges 40 40 bronze badges. BTW just to state the obvious, your method of shrinking is not a good backup method. Add a comment.
0コメント