Practice
where instead of "mydatabase" substitute the name of your own database, and instead of "mydatabase_Log" substitute the name of the log file (transaction log) for that database.
You can find the log file name by opening the Properties of that database on the "Files" tab.
2c) Click "Execute" - and voila - the transaction log file is truncated.
What we end up with:
1) The transaction log file is truncated and has a small size.
2) You should read up on "Recovery mode" modes - here's an English-language link to the Microsoft MSDN site, which explains what you lose and what you gain when applying the "Simple" type:
http://msdn.microsoft.com/en-us/library/ms189275.aspx
Let me add a couple of words myself (as I understood it from Microsoft):
- You lose: the ability to restore the database from the transaction log file in the event of a database file crash, down to the precision of the last uncompleted transaction (essentially - to the nearest second/minute).
- You gain: no continuously growing transaction log file that only grows but never shrinks, holding everything and anything for the entire lifetime of the database (as I understand it)... For a database of, say, 2GB, you can end up with a log weighing 10GB, 20GB, or even 100GB - uhh... wouldn't it be better to do a Full backup of your database more often?
Applicable to: MS SQL Server 2008
Comments