Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 386
  • Last Modified:


Hi Experts,

several days ago I have shrinked my logfile for SQL.
Now it is again 50GB. But inside the file 1% is used.

My backup is set with BE 2012.
I have a Full Backup each week.
I have two incremental jobs for DIFFERENTIAL and LOGS.

So why the grows and just 1% is filled ?
  • 4
  • 4
5 Solutions
Carl TawnSystems and Integration DeveloperCommented:
Probably because it will have had 50GB worth of data in it at some point. The log will grow as it needs to, but it won't automatically shrink back down again.

You need to be monitoring your log size and make sure it is sized appropriately. Generally your log will need to be at least the size of your largest index.
Guy Hengel [angelIII / a3]Billing EngineerCommented:
to clarify: shrinking the file regularly is not a good practice.
better make sure you are running regularly transaction log backups (if your db is in full recovery mode), and for "big jobs" (doing a lot of data modifications) ensure they are optimized.
for example, if this is a datawarehouse like db, you should consider that this kind of databases typically has nightly jobs which DO require large log files, and shrinking the file (regularly) will require to re-enlarge the file again... just a waste of I/O
Eprs_AdminSystem ArchitectAuthor Commented:
ok, I have seen in the report nearly 30% of the DB are indexes.
But how to find out how big are the indexes ?
Making Bulk Changes to Active Directory

Watch this video to see how easy it is to make mass changes to Active Directory from an external text file without using complicated scripts.

Guy Hengel [angelIII / a3]Billing EngineerCommented:
30% of the DB being indexes is likely just normal, nothing to worry about.
Eprs_AdminSystem ArchitectAuthor Commented:
There is another DB on the server .
The MDF file has 20GB and the LDF file has 85GB.
The report cannot find any extensions about the logfile.
The LDF file is used with 0.5%.
But the LDF file has 50% of indexes.
Can I shrink the file with the gui and reorganize the logfile ?
Guy Hengel [angelIII / a3]Billing EngineerCommented:
>But the LDF file has 50% of indexes.
unless the file has been incorrectly named with .ldf as extension, but actually being a data file, this is not possible.
does the file show up as log file or as data file?
if it's log file, I wonder about that report.
if it's a data file, you might consider to rename the file (but that's another question), and leave otherwise the file alone.

it might be a filegroup implementation, so you can "locate" tables or indexes on dedicated filegroups (and hence files), this to improve I/O performance .
Eprs_AdminSystem ArchitectAuthor Commented:
The DB has two files.
db.mdf and db.ldf

Strange is , the db.mdf has just 20GB
The db.ldf file has 80GB

And the report of the db shows no growing activity of the db.ldf
Guy Hengel [angelIII / a3]Billing EngineerCommented:
again: the log file may be indeed MUCH larger than the data of the db.
it really depends on the activity on your database.
if you have a HUGE job running, using lots of data transformations / extractions etc, this is perfectly NORMAL.

so, unless you check on those jobs, you cannot "know" if it's normal or not.
Eprs_AdminSystem ArchitectAuthor Commented:
ok thanks for the infos.

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 4
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now