Unix Technical Forum

transaction log

This is a discussion on transaction log within the SQL Server forums, part of the Microsoft SQL Server category; --> How can I truncate and shrink the transaction log under SQL 2000? My log is 10 GB in size ...


Go Back   Unix Technical Forum > Database Server Software > Microsoft SQL Server > SQL Server

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-29-2008, 09:12 PM
Charles MacLean
 
Posts: n/a
Default transaction log

How can I truncate and shrink the transaction log under SQL 2000? My log is
10 GB in size and I assume most of the transactions are committed.

Thanks


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-29-2008, 09:12 PM
Hugo Kornelis
 
Posts: n/a
Default Re: transaction log

On Sat, 19 Aug 2006 17:46:44 GMT, Charles MacLean wrote:

>How can I truncate and shrink the transaction log under SQL 2000? My log is
>10 GB in size and I assume most of the transactions are committed.
>
>Thanks
>


Hi Charles,

http://www.karaszi.com/SQLServer/info_dont_shrink.asp

--
Hugo Kornelis, SQL Server MVP
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 02-29-2008, 09:12 PM
Erland Sommarskog
 
Posts: n/a
Default Re: transaction log

Charles MacLean (charlesmaclean@sbcglobal.net) writes:
> How can I truncate and shrink the transaction log under SQL 2000? My
> log is 10 GB in size and I assume most of the transactions are
> committed.


First question is: if your database goes belly-up, are you content with
restoring from the lastest backup, or do you need point-in-time recovery?

If you don't need point-in-time recovery, make sure that the database is
in simple recovery, and then use DBCC SHRINKFILE to shrink the file to
a reasonable size. What is a reasonable size, is difficult to say without
knowledge about your database, but say 25% the size of the data file.

If you need point-in-time recovery you need to regulary back up the
transaction log, just like you back up the database. Your question makes
me think you don't. First make sure that your database is in FULL or
BULK-LOGGED recovery, and if it's not, you need to take a full backup
of the database. Then backup the transaction log. Again, you can shrink
it to maybe 25% of the data file.

If you are already taking regular log backups, you apparently need a
10 GB log file, and I would advise against shrinking it.

--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pro...ads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinf...ons/books.mspx
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 05:31 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com