Shrinking MS SQL Log file

Hi Team,

My Db is in simple recovery mode.  This is not PROD. So backups are not important for us.

What if i shrink .ldf files? will it cause fragmentation?
VijayAsked:
Who is Participating?

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

x
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.  The log file is sequential and can't be fragmented.

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
Pawan KumarDatabase ExpertCommented:
Shrinking will increase fragmentation. Data that is moved to shrink a file can be scattered to any available location in the file. This causes index fragmentation and can slow the performance of queries that search a range of the index. To eliminate the fragmentation, consider rebuilding the indexes on the file after shrinking.

From Microsoft - https://technet.microsoft.com/en-us/library/ms190757%28v=sql.110%29.aspx?f=255&MSPPError=-2147217396
Scott PletcherSenior DBACommented:
Btw, you need only one log file.  Multiple log files would only be used sequentially anyway.  Log file(s) don't affect data file allocation in any way at all.
Active Protection takes the fight to cryptojacking

While there were several headline-grabbing ransomware attacks during in 2017, another big threat started appearing at the same time that didn’t get the same coverage – illicit cryptomining.

VijayAuthor Commented:
Hi Pawan,

You are right. But we are not shrinking data file.

We are only planning to shring .ldf filse?
Pawan KumarDatabase ExpertCommented:
>>We are only planning to shring .ldf filse?
For ldf there should not be any fragmentation issue. The above comment is for mdf files.
VijayAuthor Commented:
Excellent answer Scott.
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
SQL

From novice to tech pro — start learning today.