MSSQL Log.MDF takes a lot of space

maxalarie
maxalarie used Ask the Experts™
on
Good day,

I have a logfile for a  MSSQL Database.  the Database is  10MG, but its Log.ldf file is 3GB big and it takes almost all my left space... Is  there a way to delete this file or maybe shrink it?

The file is located here: C:\Program Files\Microsoft SQL Server\MSSQL\Data
Name of the file: is Resourcing_log.LDF

Thanks.
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
When was the last time you backed up your SQL db? That usually clears the log file (commits the log to the db and purges the file).
Guy Hengel [angelIII / a3]Billing Engineer
Most Valuable Expert 2014
Top Expert 2009
Commented:
do you have a regular transaction log backup in place?if yes, that should take care of the file growing out of controlonce that is in place (or the database in simple recovery mode if only full restores would be needed), you can use DBCC SHRINKFILE command to shrink the file(s)
@victor
a Backup is made every week. something must be wrong somewhere..

@angel:   Thanks, I will look into that.
Introduction to Web Design

Develop a strong foundation and understanding of web design by learning HTML, CSS, and additional tools to help you develop your own website.

I use  this command:
USE [Resourcing]
GO
DBCC SHRINKDATABASE(N'Resourcing', 7 )
GO

I get this error:


Cannot shrink log file 2 (Resourcing_log) because all logical log files are in use.

(1 row(s) affected)
DBCC execution completed. If DBCC printed error messages, contact your system administrator.
Guy Hengel [angelIII / a3]Billing Engineer
Most Valuable Expert 2014
Top Expert 2009
Commented:
transaction log backups should be like every hour or so ...

Author

Commented:
Thanks

Author

Commented:
thanks

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial