![]() ![]() When the process completes, switch the recovery model back to Full or Bulk-Logged and take a full database backup. Under Shrink action, select Reorganize pages before releasing unused space and click OK. Right-click the database again and select Tasks -> Shrink -> Files. Set the recovery model to Simple and exit the menu. Right-click the database and select Properties -> Options. Note: You need the sysadmin fixed server role or the db_owner fixed database role to truncate the log. You should not need to manually truncate the log because regular log backups should automatically perform this task. Keep in mind that following these steps might result in data loss. Use the following steps to truncate the transaction log file in SQL Server Management Studio (SQL Server 2008 and later). To reduce the size of the transaction log file, you need to shrink the log file. While truncating the log makes the space available for use again, it does not decrease the transaction log file size. If you don’t take regular transaction log backups, the log file continues to grow until it runs out of space. For databases with a full or bulk-logged recovery model, the system truncates the transaction log only after a successful transaction log backup.Ī full database backup does not truncate the log. If a database is a simple recovery model, the system truncates the transaction log automatically after every transaction. ![]() #Shrinkit files how toIt outlines the different use scenarios and walks you through how to perform these tasks. This article describes the difference between shrinking and truncating the transaction log in Microsoft® SQL Server®. ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |