General problem faced by most the database server is growth in transaction log file. This causes less free memory space on database server.
To recover from a situation where the transaction logs grow to an unacceptable limit, you must reduce the size of the transaction logs. To do this, you must truncate the inactive transactions in your transaction log and shrink the transaction log file.
Truncate the inactive transactions in your transaction log
When the transaction logs grow to an unacceptable limit, you must immediately back up your transaction log file. While the backup of your transaction log files is created, SQL Server automatically truncates the inactive part of the transaction log. The inactive part of the transaction log file contains the completed transactions, and therefore, the transaction log file is no longer used by SQL Server during the recovery process. SQL Server reuses this truncated, inactive space in the transaction log instead of permitting the transaction log to continue to grow and to use more space.
Shrink the transaction log file
The backup operation or the truncate method does not reduce the log file size. To reduce the size of the transaction log file, you must shrink the transaction log file after the backup.
How to backup & Shrink the transaction log file?
- Go To the SQL Server->Management -> Maintenance Plan & Right Click -> Click on ‘New Maintenance Plan’
- Give Name to the Maintenance Plan
- Give Name to the Maintenance Plan
- Go to the menu option Views-> Toolbox
- Drag Backup Database Task from tool box to maintenance plan
- Right click and click on Edit option
- Select database for backup click on ok button
- Select Backup Type as Transaction Log & set other parameters like folder path etc. & click ok
- Drag Maintenance Cleanup Task : To clean up old transaction log file backup from backup folder. Here you can specify same backup folder and set number of days parameter, this task will automatically delete old transaction log file from specified backup folder.
- Schedule the job or run manually.
- Click on New Maintenance Plan for Shrink database
- Drag Shrink database task.
- Right Click on task & Click on Edit option.
- Select database for Shrink.
- Provide necessary information according to use and click on ok.
- Schedule Maintenance plan or run manually after transaction log back up.
Related Posts
- SQL Server 2005 database DBA Checklist for database administrator
- Backup and Restore Transaction Log in SQL Server
- [ADO.Net Tips]Transaction Scope
- SQL Server 2000 Maintenance Jobs Failed with Error 22029
- Error: SQL1263N Archive file name not valid
Tags: backup transaction log, shrink transaction log, SQL Server 2005, SQL Server Maintenance Plan, truncate transaction log





very useful, thank you very much