Contents
How do I shrink a log file in SQL Server simple recovery model?
After you set the recovery model to ‘Simple’ for a database, you can shrink the current transaction log file to regain space:
- Start Microsoft SQL Server Management Studio.
- Expand ‘Databases’.
- Right-click the database that has the transaction log you wish to shrink and select ‘Tasks’ > ‘Shrink’ > ‘Files’.
How do I set SQL Server to simple recovery?
Set SQL Server Simple Recovery Model using Management Studio
- Right click on database name and select Properties.
- Go to the Options page.
- Under Recovery model select “Simple”
- Click “OK” to save.
How to shrink a transaction log file maintenance plan?
In this section, we’ll list detail steps to Shrink a Transaction Log File Maintenance Plan in SQL Server. Login to SQL Server. From Object Explorer > Management > Maintenance Plan Wizard. Click “Next” to start “Maintenance Plan Wizard”. Specify a meaning name for your Maintenance Plan as you prefer.
When to use shrink in SQL Server transaction log?
The Transaction Log file shrink operation can be performed only if there is free space on the Transaction Log file, that can be available most of the time after truncating the inactive part of the Transaction Log. A shrink operation will be useful after performing an operation that creates a large number of Transaction Logs.
How does SQL Server work in recovery mode?
SQL Server writes to the Log file in all recovery modes, the only difference is In simple recovery mode it automatically reclaims the log space (when it can) and also logs minimum stuff to maintain transaction (just incase if you have to rollback one).
How to create a maintenance plan for SQL Server?
To create or manage Maintenance Plans in SQL Server, you must be a member of the sysadmin fixed server role. The SQL Server performance will be affected during executing the Shrink operation. Thence, we advise you to schedule the Shrink a Transaction Log File Maintenance Plan in SQL Server to be running out working hours.