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 2000 Forums
 SQL Server Administration (2000)
 truncate and shrink the transaction log

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2006-05-17 : 09:48:07
Davidg21 writes "We are using SQL Server 2005 (SP1). I have created a maintenance plan that backs up up the datebase every night. The problem is that the transaction log is continuing to grow. I have been told that a full backup will automatically truncate and shrink the transaction log. However, this is not happening. How can I truncate and shrink the transaction log after a full backup as part of our maintenance plan. Thank you."

Kristen
Test

22859 Posts

Posted - 2006-05-17 : 10:20:03
See http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=55210&SearchTerms=Why%20is%20my%20LDF%20Log%20File%20so%20big

Kristen
Go to Top of Page

SreenivasBora
Posting Yak Master

164 Posts

Posted - 2006-05-17 : 15:04:37
A full backup does not do Automatically Trauncate and shrinks the database. This is not correct.
Once you take the Full DB backup then you have to run DBCC commands explicitly to Trauncate and shrinks the log.

If the database is not critical then change the recovery mode of the database to Simple.

With Regards
BSR
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2006-05-18 : 01:13:57
"Once you take the Full DB backup then you have to run DBCC commands explicitly to Trauncate and shrinks the log"

Do NOT shrink the log (well once is OK if it got out of hand, but not as a routine)

Either set up Transaction logs, or change your Recovery Model to Simple.

Kristen
Go to Top of Page

Mathias
Posting Yak Master

119 Posts

Posted - 2007-10-23 : 10:59:21
I have done : dbcc shrinkfile (GFS_LUX_DB_Log) and it was quite radical. So I lost all the redo logs.

How do I create a job that freezes the current .ldf every 30 minutes and creates a new one. That way I can recover the data by playing the .ldf on the recovery site and only 30 minutes can be lost?
Go to Top of Page

nr
SQLTeam MVY

12543 Posts

Posted - 2007-10-23 : 11:01:40
You wantto backup the log.
That will release the entries at the next checkpoint and they will be overwritten so the log will not grow.
You can then apply the sequence of log backups after a full backup restore (but not recovery).
Have a look at the link I posted earlier.
oops different thread
http://www.nigelrivett.net/SQLAdmin/TransactionLogFileGrows_1.html


==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2007-10-23 : 12:43:38
"I have created a maintenance plan that backs up up the datebase every night. The problem is that the transaction log is continuing to grow"

I suggest you add Transaction Backups to your maintenance plan. Every 10-15 minutes is a reasonable time interval.

See also: http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=55210&SearchTerms=How%20Backup%20works,What%20type%20of%20backup%20should%20I%20use,Automating%20Backups,Backup

Kristen
Go to Top of Page
   

- Advertisement -