Tell me more ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

I have an application build on SharePoint 2007 platform, and currently I encounter a common issue where the Database Log file growth rapidly and fill up the hard disk space.

In my situation, I wanted to remain the recovery model as FULL because in future might need for point-in-time recovery and database mirroring.

My question is, how can I perform an automated backup of transaction log regularly? please advice and this is open for any comment.

Thank you in advanced.

share|improve this question

migrated from stackoverflow.com Jan 6 '12 at 15:40

1 Answer

Try to write corresponding job, which will back the log up, or create the simple Maintenance Task for this. The command is quite simple:

BACKUP LOG YourDb TO YourBackupDevice;
share|improve this answer
Couple this with a SQL agent job and you should be good. – Jason Cumberland Jan 6 '12 at 7:27
Thanks for the reply, if I create a maintenance task to backup the log, the log file size will still huge, can the maintenance task can help to reduce the size? – Nelson Tan Jan 6 '12 at 7:47
You can do DBCC shrinkfile(logname, truncateonly) after the backup, but I recommend to set up the size of log to acceptable value and do your backups more often – Oleg Dok Jan 6 '12 at 7:53
set up the size of log mean?? is it the maximum growth size of the log file? – Nelson Tan Jan 6 '12 at 8:19
1  
You typically don't want to truncate your log files. Doing so causes you to end up with a large number of VLFs in the log file and that causes fragmentation and performance issues. See sqlskills.com/blogs/kimberly/post/… and sqlskills.com/BLOGS/KIMBERLY/post/… for more information. – Brandon Jan 6 '12 at 21:45
show 1 more comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.