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 169953
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T12:43:20+00:00 2026-05-11T12:43:20+00:00

I consider myself a very experienced SQL person. But I’m failing to do these

  • 0

I consider myself a very experienced SQL person. But I’m failing to do these two things:

  • Reduce the size of the allocated log.
  • Truncate the log.

    DBCC sqlperf(logspace)

returns:

Database Name   Log Size (MB)   Log Space Used (%)  Status ByBox       1964.25     30.0657         0 

The following does not work with SQL 2008

DUMP TRANSACTION ByBox WITH TRUNCATE_ONLY 

Running the following does nothing either

DBCC SHRINKFILE ('ByBox_1_Log' , 1) DBCC shrinkdatabase(N'bybox') 

I’ve tried backups. I’ve also tried setting the properties of the database – ‘Recover Model’ to both ‘FULL’ and ‘SIMPLE’ and a combination of all of the above. I also tried setting the compatibility to SQL Server 2005 (I use this setting as I want to match our production server) and SQL Server 2008.

No matter what I try, the log remains at 1964.25 MB, with 30% used, which is still growing.

I’d like the log to go back down near 0% and reduce the log file size to, say, 100 MB which is plenty. My database must hate me; it just ignores everything I ask it to do regarding the log.

One further note. The production database has quite a few replicated tables, which I turn off when I perform a restore on my development box by using the following:

-- Clear out pending replication stuff exec sp_removedbreplication go EXEC sp_repldone @xactid = NULL, @xact_segno = NULL,      @numtrans = 0, @time = 0, @reset = 1 go 

Trying:

SELECT log_reuse_wait, log_reuse_wait_desc FROM sys.databases WHERE NAME='bybox' 

Returns

log_reuse_wait  log_reuse_wait_desc 0   NOTHING 

How can I fix this problem?


Looking at this and setting the recovery model to FULL I have tried the following:

USE master GO  EXEC sp_addumpdevice 'disk', 'ByBoxData', N'C:\<path here>\bybox.bak'  -- Create a logical backup device, ByBoxLog. EXEC sp_addumpdevice 'disk', 'ByBoxLog', N'C:\<path here>\bybox_log.bak'  -- Back up the full bybox database. BACKUP DATABASE bybox TO ByBoxData  -- Back up the bybox log. BACKUP LOG bybox TO ByBoxLog 

which returned:

Processed 151800 pages for database 'bybox', file 'ByBox_Data' on file 3. Processed 12256 pages for database 'bybox', file 'ByBox_Secondary' on file 3. Processed 1 pages for database 'bybox', file 'ByBox_1_Log' on file 3. BACKUP DATABASE successfully processed 164057 pages in 35.456 seconds (36.148 MB/sec).  Processed 2 pages for database 'bybox', file 'ByBox_1_Log' on file 4. BACKUP LOG successfully processed 2 pages in 0.056 seconds (0.252 MB/sec). 

Perfect! But it’s not.

And DBCC SHRINKFILE (‘ByBox_1_Log’ , 1) now returns with

DbId    FileId  CurrentSize MinimumSize UsedPages   EstimatedPages 7   2   251425  251425  251424  251424 

and DBCC SQLPERF(LOGSPACE) still reports 30% usage.

I think I may have to resign myself to the fact there could well be a bug in SQL Server 2008, or that my log file has been corrupted in some manner. However, my database is in good working order, which leads me to think there is a bug (shudders at the thought).

  • 1 1 Answer
  • 1 View
  • 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. 2026-05-11T12:43:20+00:00Added an answer on May 11, 2026 at 12:43 pm

    Found the solution!

    I added a load of data to the database, so the log was forced to expand. I then removed the uneeded data to get my database back to how it was.

    Backup and voila, a perfect 0% log.

    So the solution is to make the log expand.

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

Sidebar

Related Questions

I consider myself a very beginner at python(and programming in general!), but I am
I consider myself to be quite a good programmer but I know very little
I consider myself an experienced Java developer and am planning to get started with
So I would consider myself a .Net and ASP.NET pro but I am a
So I don't consider myself a novice at MySQL but this one has me
I'd consider myself a reasonable standard CSS/XHTML chap but I'm pretty baffled by this.
I've been developing for quite a while but while I consider myself competent (or
Greetings, everyone. I consider myself to be an intermediate developer, but, to be candid,
I've been coding for a while, but still consider myself a beginner. I use
I consider myself an experienced programmer and understand the basic concept of dependency injection.

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.