Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7916155
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T14:42:12+00:00 2026-06-03T14:42:12+00:00

I have a database .mdf file that is 138 GB along with a transaction

  • 0

I have a database .mdf file that is 138 GB along with a transaction log file of 55 GB.

The recovery model was set to Full (which it doesn’t need to be). I ran a full backup of the database and the transaction log. The transaction log is still 55 GB with no free space to shrink the file.

I ran that backup through SQL Server Management Studio GUI. I then ran the following commands to try to force the trans log to shrink:

BACKUP LOG database WITH TRUNCATE_ONLY
DBCC SHRINKFILE (logfile, TRUNCATEONLY )

The log file is still 55 GB. I then changed the recovery model to Simple and let it sit a few days, but it’s still at 55 GB. I tried those 2 commands above again but it still doesn’t truncate anything.

No matter what I try, this log file won’t shrink. Since we don’t need the transaction log at all, I even tried detaching the database, renaming the log file and reattaching. That doesn’t work either as there are actually 2 transaction logs, and I get an error when trying to reattach without the logs. The other log file is only 1 MB, and I’ve tried to remove that as well, but get also get an error saying it’s not empty.

Is there something I’m missing, or something else I can try?

Thanks for any help!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T14:42:13+00:00Added an answer on June 3, 2026 at 2:42 pm

    “I even tried detaching the database, renaming the log file and reattaching”: The log is not an optional component! Run DBCC CHECKDB immediately to see if you have caused corruption. You will cause corruption if there were unflushed pages for some reason. Even if not you are gambling.

    The SQL Server log file is not an informational text log.

    If you don’t need the log, switch to simple mode and shrink the log file (you already did that). TRUNCATE_ONLY is obsolete, I don’t know if it even does anything.

    Look at sys.databases and look at the value in the log_reuse_wait_desc column. It will tell you what is keeping the log around.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a database (mdf file) which I'm approaching with the Entity Framework. Is
I have written c# application that uses mdf file for database.when i make setup
I have query like that in my DataSet (database is located in .mdf file):
I have designed a database whose MDF file will be copied to remote offices,
I am creating 2 projects that have the same database (it's an MDF database).
I have two List<string> ( listOfFullPaths containg full database paths for e.g. C:\MyDir\SomeDir\SomeDatabase.mdf) and
I have created my first project in C# which uses sql server database (file
I am using SQL Server 2008 and I have a database file (mydata.mdf) in
I have a database backup for which SQL Server Management Studio says that it
I have a Sql Server 2008 Express database file that's currently being used by

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.