Cannot shrink log file because of min log space.

I had this question after viewing Cannon shrink log file because of minimum log space required..

I found the above answered question.  I have a similar issue but someone initially told us to use sp_replflush.  We did that but still receive can't shrink because of min log space required.  What do we need to do so we can shrink the log file.  The database is a test db that was restored from a production db that had replication on it but don't need on the test db.  I guess we need all the steps involved when we copy a production db with replication to a test environment without it having any log transactions to fill from replication.
LVL 1
ibgadminAsked:
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.

ibgadminAuthor Commented:
BTW - we are running SQL Server 2012 Standard
0
Vitor MontalvãoMSSQL Senior EngineerCommented:
The database is a test db that was restored from a production db that had replication on it but don't need on the test db
I think that's your main problem. You created the database from a restore so it will keep the Production configuration. In SQL Server, you can't shrink a file to a size lower that when it was created.
My suggestion to solve this issue is to perform a transaction log backup followed by a shrink log file on the Production database, back it up immediately and restore it in your test machine so it will restore with a smaller transaction log file.
0
Qlemo"Batchelor", Developer and EE Topic AdvisorCommented:
No clue if that works, but how about adding a log file, migrate transactions to it, and then remove​ the old one?
0
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

ibgadminAuthor Commented:
I was able to resolve this by running a log backup TWICE on the test db.  I read that somewhere in a thread about issues with shrinklog about running twice.  Thanks for your help.
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:
ibgadmin, if your issue is solved, please close this question.
0
ibgadminAuthor Commented:
Issue resolved - I was able to resolve this by running a log backup TWICE on the test db.  I read that somewhere in a thread about issues with shrinklog about running twice.  Thanks for your help.
0
Vitor MontalvãoMSSQL Senior EngineerCommented:
As per author's comment
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.