Solved

Large Log size

Posted on 2014-11-06
4
106 Views
Last Modified: 2014-11-23
Hi,

I have a database with the following statistics:

Database Name      Log Size (MB)      Log Space Used (%)       Status
CM_XXX                       71582.24                       0.2899746                        0

So the log size is quite large nearly filling up the disk. So does this indicate an issue why the log is so large,
yet % full is so small.

Is the recommendation to shrink the database or shrink the files.

Also can this be done while the database is being used. Do need to have this amount of space free on the same size as the log drive or does it use windows\temp?

Thanks,

Ward
0
Comment
Question by:whorsfall
4 Comments
 
LVL 32

Expert Comment

by:Stefan Hoffmann
Comment Utility
7GB is not really that much space. The size of the log tells you that you had operations which reqired that much log space. When you haven't done anything which broke ranks, shrinking makes imho not much sense.

Yes, you can shrink it while the database is online. Just use the SSMS task Shrink > Files.
0
 

Author Comment

by:whorsfall
Comment Utility
Hi,

Thanks for your answer. Sorry I might not of been clear in my explanation the size of the file on the disk is:

69.9 GB (75,059,429,376 bytes) - This is what was concerning me.

So does that change things at all?

Thanks,

Ward
0
 
LVL 87

Expert Comment

by:rindi
Comment Utility
Make sure your backup utility is SQL aware, and that it does full backups, and that it is successful with the backups. That will cleanup the logs.
0
 
LVL 69

Accepted Solution

by:
ScottPletcher earned 500 total points
Comment Utility
You need to check the recovery model for the db (SIMPLE, BULK-LOGGED, or FULL) and what, if anything, is preventing the current log space from being re-used.

SELECT log_reuse_wait_desc, recovery_model_desc, *
FROM sys.databases
WHERE name = '<your_db_name>'

At this point, I'd suggest initially clearing the log rather than backing it up.  You wouldn't ever want to take the time to use a log that big for a forward recovery anyway.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Everyone has problem when going to load data into Data warehouse (EDW). They all need to confirm that data quality is good but they don't no how to proceed. Microsoft has provided new task within SSIS 2008 called "Data Profiler Task". It solve th…
Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
Using examples as well as descriptions, and references to Books Online, show the different Recovery Models available in SQL Server and explain, as well as show how full, differential and transaction log backups are performed
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now