Home All Groups Group Topic Archive Search About
Author
5 Oct 2007 5:20 AM
Allan M. Grafil
Hi guys,

I dont know if im in the right group.  My scenario is like this.
Transaction logs are eating up my server's hard drive. Almost 60% of my
space is transaction log.  What are these? Can I simply delete it? Can I
compress this?  Can someone explain this log file.

Thank you in advance.



Allan M. Grafil

Author
5 Oct 2007 7:47 AM
Razvan Socol
Allan M. Grafil wrote:
> Transaction logs are eating up my server's hard drive. Almost 60% of
> my space is transaction log.  What are these? Can I simply delete it?
> Can I compress this?  Can someone explain this log file.

You need to backup the transaction log regularly or switch to simple
recovery model. For more information, see:
http://technet.microsoft.com/en-us/library/ms189275.aspx
http://support.microsoft.com/kb/873235

--
Razvan Socol
SQL Server MVP
Author
5 Oct 2007 5:20 PM
Mohit K. Gupta
Too add Razvan's comment backup is the perfered manner; but I know some
people just simply truncate the logs and shink the or regular basis because
they don't need to the point-of-failure restores.

BACKUP LOG DBNAME WITH NO_LOG
DBCC SHRINKFILE file, targetsize

Thanks!
--
Mohit K. Gupta
B.Sc. CS, Minor Japanese
MCTS: SQL Server 2005


Show quote
"Razvan Socol" wrote:

> Allan M. Grafil wrote:
> > Transaction logs are eating up my server's hard drive. Almost 60% of
> > my space is transaction log.  What are these? Can I simply delete it?
> > Can I compress this?  Can someone explain this log file.
>
> You need to backup the transaction log regularly or switch to simple
> recovery model. For more information, see:
> http://technet.microsoft.com/en-us/library/ms189275.aspx
> http://support.microsoft.com/kb/873235
>
> --
> Razvan Socol
> SQL Server MVP
>
Author
6 Oct 2007 9:32 PM
Erland Sommarskog
Allan M. Grafil (agra***@hotmail.com) writes:
> I dont know if im in the right group.  My scenario is like this.
> Transaction logs are eating up my server's hard drive. Almost 60% of my
> space is transaction log.  What are these? Can I simply delete it? Can I
> compress this?  Can someone explain this log file.

First of all: never, I repeat NEVER delete your log file.

Next: decide, what level of recovery do you need? If your database goes
belly-up, are you content with restoring the most recent backup, or do
your business require up-to-the-point recovery?

In the first case, run ALTER DATBASE db SET RECOVERY SIMPLE and run
DBCC SHRINKFILE with a target size that is 20-25% of your data file.
Please check Books Online for the exact case. With simple recovery, the
transaction log is frequently truncated. You should still have some
size to permit for huge transactions. If you make it too small, it
will grow, but growing steals performance.

If you need up-to-the-point recocvery, you need backup the transaction
log regularly, probably at least as often as once an hour. If you don't
back up the log, it just keeps growing.

--
Erland Sommarskog, SQL Server MVP, esq***@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx

AddThis Social Bookmark Button