How to shrink log files in management plan?
-
Tuesday, July 12, 2011 7:52 AM
I look for the a maintenance plan that do the same as the following SQL statement:
dump transaction [db_name] with no_log
after this statement the SHRINK FILE operation do the work, but without it the files remain in large size.
How can I do it in maintenance plan wizard?
All Replies
-
Tuesday, July 12, 2011 8:11 AM
Hi Rut,
Which SQL Server version you're referring to?
Dump is unsupported from quite a long time.
For Shrinking Log file (SQL Server 2000)
use Backup Log <db_name> with truncate_only
which will truncate the inactive portion of the log
After that you may use
DBCC SHRINKFILE ('LogicalLogFileName',target size)
Regards,
Vishal Srivastava.
Regards, Vishal Srivastava- Proposed As Answer by Srivastava Vishal Tuesday, July 12, 2011 8:11 AM
-
Tuesday, July 12, 2011 11:18 AM
you can do this with below statement....
1. change your recovery model to simple
2. shrink log file ... dbcc shrinkfile(2)
3. revert recovery model back to normal...
Permanent solution for this is you have to configure regular log backups that is the only way we can control log file size as log backs only flag in-active portion of log file to re-use, other wise log file will grow and cause space issues....
hope this helps you
http://uk.linkedin.com/in/ramjaddu -
Friday, July 15, 2011 8:40 AM
I look for the a maintenance plan that do the same as the following SQL statement:
dump transaction [db_name] with no_log
after this statement the SHRINK FILE operation do the work, but without it the files remain in large size.
How can I do it in maintenance plan wizard?
Please Don't ever never shrink your files.Read the post which will help you. Read it
Read the bottom of the post "How to avoid the shrinking?"
Muthukkumaran Kaliyamoorthy SQL DBA
Helping SQL DBAs and Developers >>>SqlserverBlogForum- Edited by muthukkumaran kaliyamoorthy Saturday, November 19, 2011 9:51 AM to fix url
-
Tuesday, July 19, 2011 1:18 PM
Yup, I fully agree with you,Muthu.
However, there may the scenario where you have no alternative available other than shrinking.
Regards,
Vishal.
Regards, Vishal Srivastava- Proposed As Answer by Srivastava Vishal Tuesday, July 19, 2011 1:18 PM

