SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


transaction log size reduction


transaction log size reduction

Author
Message
sqlfriends
sqlfriends
One Orange Chip
One Orange Chip (27K reputation)One Orange Chip (27K reputation)One Orange Chip (27K reputation)One Orange Chip (27K reputation)One Orange Chip (27K reputation)One Orange Chip (27K reputation)One Orange Chip (27K reputation)One Orange Chip (27K reputation)

Group: General Forum Members
Points: 27720 Visits: 4453
Does backup of transaction log reduce the log file size or it is DBCC SHRINKFILE really make the size small?

I know it is not good practice to shrink log, but we have special case that need to do that to save space. For example we have some archived databases and set to readonly, and simple recovery mode,
we don't need those big log file there, so I was able to shrink the log size to a smaller one.

But I remember somewhere I read only backup transaction log reduces the size, not shrink , or maybe I didn't remmember it correctly?

Thanks
GilaMonster
GilaMonster
SSC Guru
SSC Guru (548K reputation)SSC Guru (548K reputation)SSC Guru (548K reputation)SSC Guru (548K reputation)SSC Guru (548K reputation)SSC Guru (548K reputation)SSC Guru (548K reputation)SSC Guru (548K reputation)

Group: General Forum Members
Points: 548541 Visits: 47739
Log backups don't change the size of the file, they just mark the space inside as reusable.

Please read through this - Managing Transaction Logs

Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

We walk in the dark places no others will enter
We stand on the bridge and no one may pass


Grant Fritchey
Grant Fritchey
SSC Guru
SSC Guru (221K reputation)SSC Guru (221K reputation)SSC Guru (221K reputation)SSC Guru (221K reputation)SSC Guru (221K reputation)SSC Guru (221K reputation)SSC Guru (221K reputation)SSC Guru (221K reputation)

Group: General Forum Members
Points: 221495 Visits: 33556
And this one too.

----------------------------------------------------
The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood...
Theodore Roosevelt

The Scary DBA
Author of: SQL Server Query Performance Tuning and SQL Server Execution Plans
Product Evangelist for Red Gate Software
ganasulochana
ganasulochana
Grasshopper
Grasshopper (11 reputation)Grasshopper (11 reputation)Grasshopper (11 reputation)Grasshopper (11 reputation)Grasshopper (11 reputation)Grasshopper (11 reputation)Grasshopper (11 reputation)Grasshopper (11 reputation)

Group: General Forum Members
Points: 11 Visits: 0
If the database is in Full recovery model then you can able to take the log backup.
sqlfriends
sqlfriends
One Orange Chip
One Orange Chip (27K reputation)One Orange Chip (27K reputation)One Orange Chip (27K reputation)One Orange Chip (27K reputation)One Orange Chip (27K reputation)One Orange Chip (27K reputation)One Orange Chip (27K reputation)One Orange Chip (27K reputation)

Group: General Forum Members
Points: 27720 Visits: 4453
Thanks all, so I think I remember it wrong,

What is correct should be:

Backup transaction log is only mark part of transaction log file active, so it could be reused, and it will not make the size small.
Shrink will actually reduce the size of the log file.
sqlfriends
sqlfriends
One Orange Chip
One Orange Chip (27K reputation)One Orange Chip (27K reputation)One Orange Chip (27K reputation)One Orange Chip (27K reputation)One Orange Chip (27K reputation)One Orange Chip (27K reputation)One Orange Chip (27K reputation)One Orange Chip (27K reputation)

Group: General Forum Members
Points: 27720 Visits: 4453
ganasulochana (3/28/2013)
If the database is in Full recovery model then you can able to take the log backup.


for simple recovery mode, when it will do the checkpoints?
GilaMonster
GilaMonster
SSC Guru
SSC Guru (548K reputation)SSC Guru (548K reputation)SSC Guru (548K reputation)SSC Guru (548K reputation)SSC Guru (548K reputation)SSC Guru (548K reputation)SSC Guru (548K reputation)SSC Guru (548K reputation)

Group: General Forum Members
Points: 548541 Visits: 47739
sqlfriends (3/28/2013)
ganasulochana (3/28/2013)
If the database is in Full recovery model then you can able to take the log backup.


for simple recovery mode, when it will do the checkpoints?


Checkpoint runs on a regular basis in databases in all recovery models. Recovery model doesn't change how often checkpoint runs, it depends on data changes and the recovery interval setting.

Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

We walk in the dark places no others will enter
We stand on the bridge and no one may pass


sqlfriends
sqlfriends
One Orange Chip
One Orange Chip (27K reputation)One Orange Chip (27K reputation)One Orange Chip (27K reputation)One Orange Chip (27K reputation)One Orange Chip (27K reputation)One Orange Chip (27K reputation)One Orange Chip (27K reputation)One Orange Chip (27K reputation)

Group: General Forum Members
Points: 27720 Visits: 4453
GilaMonster (3/28/2013)
sqlfriends (3/28/2013)
ganasulochana (3/28/2013)
If the database is in Full recovery model then you can able to take the log backup.


for simple recovery mode, when it will do the checkpoints?


Checkpoint runs on a regular basis in databases in all recovery models. Recovery model doesn't change how often checkpoint runs, it depends on data changes and the recovery interval setting.


Thanks much, is there a way that I can find out what it the 'recovery interval setting'?
GilaMonster
GilaMonster
SSC Guru
SSC Guru (548K reputation)SSC Guru (548K reputation)SSC Guru (548K reputation)SSC Guru (548K reputation)SSC Guru (548K reputation)SSC Guru (548K reputation)SSC Guru (548K reputation)SSC Guru (548K reputation)

Group: General Forum Members
Points: 548541 Visits: 47739
Sure, look it up on the server properties window, in sys.configurations or sp_configure.

Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

We walk in the dark places no others will enter
We stand on the bridge and no one may pass


MyDoggieJessie
MyDoggieJessie
One Orange Chip
One Orange Chip (26K reputation)One Orange Chip (26K reputation)One Orange Chip (26K reputation)One Orange Chip (26K reputation)One Orange Chip (26K reputation)One Orange Chip (26K reputation)One Orange Chip (26K reputation)One Orange Chip (26K reputation)

Group: General Forum Members
Points: 26758 Visits: 7488
If you haven't specified it during the initial install, it's set to 0 by default, meaning that it happens automatically (running approximately every 1 minutes for active DB's)

Reference MSDN here

______________________________________________________________________________
Never argue with an idiot; Theyll drag you down to their level and beat you with experience

Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum








































































































































































SQLServerCentral


Search