Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 SQL Server Administration (2008)
 21 gb log file

Author  Topic 

esthera
Master Smack Fu Yak Hacker

1410 Posts

Posted - 2012-01-23 : 12:24:30
I have a 21 gb log file

the db is big because there is a table with many archived records

what can I do to reduce the size of the log file
I tried backing up and truncating but it didn't help

what can I do to help this?

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2012-01-23 : 12:37:44
How big is your mdf file? Backing up/truncating only affects what's inside the log file.

What is your recovery model set to? If it's not SIMPLE recovery model, then how often are you backing up the transaction log?

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

GilaMonster
Master Smack Fu Yak Hacker

4507 Posts

Posted - 2012-01-23 : 12:41:11
Please read through this - [url]http://www.sqlservercentral.com/articles/64582/[/url]

--
Gail Shaw
SQL Server MVP
Go to Top of Page

esthera
Master Smack Fu Yak Hacker

1410 Posts

Posted - 2012-01-23 : 12:44:08
mdf is 15 mb

I just set the log file to backup transaction log every 15 minutes (but only set that an hour ago - should that help)
recovery is set to full
Go to Top of Page

biswajitdas
Starting Member

44 Posts

Posted - 2012-01-23 : 13:44:00
we can do in other steps that add another log file to database , and remove the 21gb one.
But make sure there is no activity going on the database.


Sr Sql server DBA/Artitech
Go to Top of Page

jeffw8713
Aged Yak Warrior

819 Posts

Posted - 2012-01-23 : 14:12:00
quote:
Originally posted by biswajitdas

we can do in other steps that add another log file to database , and remove the 21gb one.
But make sure there is no activity going on the database.


Sr Sql server DBA/Artitech



Bad idea...the proper approach is to make sure you are taking regular transaction log backups. If your database does not need point in time recovery, you can switch to simple recovery model and avoid the frequent transaction log backups.

Once you have that done - then you can perform a one time shrink of the log back down to normal operating size.

Jeff
Go to Top of Page

GilaMonster
Master Smack Fu Yak Hacker

4507 Posts

Posted - 2012-01-23 : 14:22:51
quote:
Originally posted by biswajitdas

we can do in other steps that add another log file to database , and remove the 21gb one.
But make sure there is no activity going on the database.


Totally unnecessary, to get it down to a reasonable size a simple shrink would suffice, once we've identified the size to shrink it to and have fixed the maintenance problems that caused the huge growth in the first place.

Also, iirc you can't remove the first log file that a DB has. You can add and then remove other log files, but not the first.

--
Gail Shaw
SQL Server MVP
Go to Top of Page
   

- Advertisement -