Shrink log files

I have a situation where the log files on two db's filled up a partition.
I just moved the recovery mode to simple for both of these db's

now...
what is the next best way for it to "take action" and shrink just the logs files....
should I restart the server?
is there a less intrusive process.
jamesmetcalf74Asked:
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.

Scott PletcherSenior DBACommented:
No, don't restart the server.

Just CHECKPOINT the dbs and then shrink the logs.

USE db1
CHECKPOINT
DBCC SHRINKFILE ( 2, <#mb_to_shrink_log_to> )
USE db2
CHECKPOINT
DBCC SHRINKFILE ( 2, <#mb_to_shrink_log_to> )
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
Vitor MontalvãoMSSQL Senior EngineerCommented:
You should perform an immediate full backup of the databases.
By the way, you should find why they filled. There is any transaction log backup job set for the databases?
0
Scott PletcherSenior DBACommented:
After you get the logs back down to a reasonable size, if you put the db back into FULL recovery model, you'll need to take a full backup of the db then.
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

Deepak ChauhanSQL Server DBACommented:
If your database in FULL recovery model you have to take transaction log backup otherwise keep it in simple recovery mode.

You can query sys.databases system view here check the log_reuse_wait_desc column,  value should be nothing,
otherwise you can see the log file locked by process.
eg: replication, active_log_backup, Active_transactions.

these are the few example which lead the log grow large.
Take appropriate action accordingly.
0
Steve WalesSenior Database AdministratorCommented:
Please have a read of this article:  http://www.experts-exchange.com/articles/11077/How-to-shrink-a-bloated-log-file.html

In Full Recovery mode, your log files will grow  forever until you take a log backup.  Taking a log backup truncates the log file (that is not the same as shrinking - it just means marks the file as available for reuse).

Fix the existing situation (see Shrink commands above) and make sure you manually regrow the log file to a size that meets your transaction volume needs then make sure you're taking regular log backups.
0
Deepak ChauhanSQL Server DBACommented:
Above is the approx same explanation as well.
0
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.