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)
 truncating the transaction log 2008 r2

Author  Topic 

kpgraci
Yak Posting Veteran

68 Posts

Posted - 2011-07-07 : 17:13:45
I've read:

http://technet.microsoft.com/en-us/library/ms189085.aspx

and it is very informative.

I'm using full recovery model, I do weekly full backups,
daily differentials, and hourly tlog backups, all scheduled
with the maintenance plan wizard and run by sql agent.

From the article there are several things that can prevent log truncation, but I do not believe I have met all the requirements.

I also ran a manually ran a checkpoint, then did a tlog backup and still the tlog was not truncated.

I've read other articles that switch to simple recovery model, then do a checkpoint, back to full, backup...way to much, this should just work.

what could be preventing the log from truncating other than what is talked about in that article?

kpg

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2011-07-07 : 17:23:16
What does sys.databases show for the log_reuse_wait_desc column for your database?

select log_reuse_wait_desc from master.sys.databases
where name = 'Database1'

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

Subscribe to my blog
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2011-07-07 : 17:23:58
On my systems, the culprits are mirroring, replication, and transactions left open. Sigh.

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

Subscribe to my blog
Go to Top of Page

kpgraci
Yak Posting Veteran

68 Posts

Posted - 2011-07-07 : 17:34:16
I should have read the article a little closer.

"Truncation does not reduce the size of a physical log file."

So I did a manual shrink file in mgmt studio and it did shrink in physical size, so there was free space in the log file.

thx



kpg
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2011-07-07 : 17:35:28
Oh ok, I thought you knew that already.

Hopefully your shrink is a one-time thing only. Shrinks should NOT be done regularly. If your file size is getting too big, then you need to backup your tlog more frequently or you've got large transactions that need the space.

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

Subscribe to my blog
Go to Top of Page

kpgraci
Yak Posting Veteran

68 Posts

Posted - 2011-07-07 : 19:24:08
quote:
Originally posted by tkizer

Oh ok, I thought you knew that already.

Hopefully your shrink is a one-time thing only. Shrinks should NOT be done regularly. If your file size is getting too big, then you need to backup your tlog more frequently or you've got large transactions that need the space.


Yeah, I'm working with limited space for now, so I just wanted to make sure the tlog backups were allowing the tlog file to not just keep growing...I won't shrink anymore now that I know it is being recylced.

thx again

kpg
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2011-07-07 : 19:41:03
Consider changing your tlog backup schedule to every 15 minutes. That's the best way to manage its size. Every 15 minutes is very common.

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

Subscribe to my blog
Go to Top of Page
   

- Advertisement -