SQL Server 2012 Transaction Log is Full. I need to reduce size

I had a SQL Server 2012 transaction log become full.  I created a second log file on another disk so that I could keep the database working.  I ran a transaction log backup using SQL Server Management Studio.  It was over 400G.  At this point, how do I reduce the size of the "full" transaction log?
PhilshAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Steve WalesSenior Database AdministratorCommented:
Have a read of this article on this topic: http://www.experts-exchange.com/articles/11077/How-to-shrink-a-bloated-log-file.html

Your log file has grown because you're in Full Recovery mode and probably not running regular log backups.

The article above tells you how to shrink your log file - DBCC SHRINKFILE (dbname_log, 2) - replacing dbname.log with your logical file name.

You may need to run the command twice.

Alternatively you could have put into Simple Mode, done the shrink, returned to Full and run an immediate Full backup again - but doing it this way breaks your recovery chain.

Since you state you've already backed up the log file, you may as well go with the first option.
1
PhilshAuthor Commented:
Can i run this while database is being used?
0
Steve WalesSenior Database AdministratorCommented:
Yes, but you're more than likely going to get better results if you do it during a period of low activity.

Take another log backup.
Run the DBCC SHRINKFILE (twice - just to tidy up on any in flight transactions)
0
PhilshAuthor Commented:
can i shrink first as the log file is very large. i hate to back it up again as it takes a long time.
0
Steve WalesSenior Database AdministratorCommented:
When you backed it up the first time, it marked the whole file as backed up and pretty much started writing again from the front of the file.

Backing it up again is only to get you the best shrink possible.

Since you've already backed it up once, try it - you should get a fairly decent shrink out of it.

Just make sure you start taking regular log backups to prevent this from happening again.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft SQL Server

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.