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

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.
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

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
DBCC SHRINKFILE ( 2, <#mb_to_shrink_log_to> )
USE db2
DBCC SHRINKFILE ( 2, <#mb_to_shrink_log_to> )

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?
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.
IT Pros Agree: AI and Machine Learning Key

We’d all like to think our company’s data is well protected, but when you ask IT professionals they admit the data probably is not as safe as it could be.

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.
Steve WalesSenior Database AdministratorCommented:
Please have a read of this article:

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.
Deepak ChauhanSQL Server DBACommented:
Above is the approx same explanation as well.
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.