Solved

Very Large LDF File

Posted on 2013-02-07
5
403 Views
Last Modified: 2013-02-07
I have a database that has a 10gb LDF file.  I have tried shrinking it using dbcc shrinkfile which does not do anything to the file at all.

The recovery mode is set to full and we use windows backup to backup the databases to an external hard drive.

Any ideas on how to get this file smaller?

Thanks
0
Comment
Question by:TreeMaster
  • 3
  • 2
5 Comments
 
LVL 75

Assisted Solution

by:Aneesh Retnakaran
Aneesh Retnakaran earned 500 total points
ID: 38865738
>Any ideas on how to get this file smaller?
You have to backup the database logs at regular intervals; dont stick with the windpws backup, you must create proper backup plans, full backup at least once /day or per week; regular log backups etc.

In order to shrink the file, change the recovery to simple do a log file shrink;
you also need to check the initial size of the log file, if it is set to 10gb, it wont shrink
0
 

Author Comment

by:TreeMaster
ID: 38865849
Would you recommend using  the SQLCMD via command line to do this?

sqlcmd -S.\SQLExpress -Q"BACKUP DATABASE dbName  TO DISK = 'path'"

I have been playing around with this and it seems to create a .bak file but if I run it again it will continue to add to the file.  Is there a way to make this a differential backup?
0
 

Author Comment

by:TreeMaster
ID: 38865859
I am using SQL Express if that helps
0
 
LVL 75

Accepted Solution

by:
Aneesh Retnakaran earned 500 total points
ID: 38865910
0
 

Author Comment

by:TreeMaster
ID: 38866022
Got it! thank you very much
0

Featured Post

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
SQL Server Results to Excel File 18 73
sql 2014,  lock limit 5 45
date diff with Fiscal Calendar 4 74
Database-Scoped Permissions 2 10
This is basically a blog post I wrote recently. I've found that SARGability is poorly understood, and since many people don't read blogs, I figured I'd post it here as an article. SARGable is an adjective in SQL that means that an item can be fou…
SQL Server engine let you use a Windows account or a SQL Server account to connect to a SQL Server instance. This can be configured immediatly during the SQL Server installation or after in the Server Authentication section in the Server properties …
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

679 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