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


Log file backup growth (how long's a piece of string...)


Log file backup growth (how long's a piece of string...)

Author
Message
GilaMonster
GilaMonster
SSC Guru
SSC Guru (554K reputation)SSC Guru (554K reputation)SSC Guru (554K reputation)SSC Guru (554K reputation)SSC Guru (554K reputation)SSC Guru (554K reputation)SSC Guru (554K reputation)SSC Guru (554K reputation)

Group: General Forum Members
Points: 554639 Visits: 47747
Yes. You're appending the log backups all to the same file. Hence each time you take a log backup, the file gets bigger by the size of the log backup that just ran.

Not a good idea. Write your backup statement so that each time the backup runs it backs up to a new file, easiest way is to stamp the date and time into the file name.

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 (223K reputation)SSC Guru (223K reputation)SSC Guru (223K reputation)SSC Guru (223K reputation)SSC Guru (223K reputation)SSC Guru (223K reputation)SSC Guru (223K reputation)SSC Guru (223K reputation)

Group: General Forum Members
Points: 223883 Visits: 33569
Beatrix Kiddo (9/16/2013)
When I run that I get 7 rows back. Is that the sort of thing you suspected?

Thanks


Yep. It's as Gail says.

----------------------------------------------------
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
Beatrix Kiddo
Beatrix Kiddo
SSCoach
SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)

Group: General Forum Members
Points: 16437 Visits: 5678
Brilliant, thank you. I must confess I woke up in the middle of the night and that exact thought popped into my brain. I'm just run so ragged at the moment I'm making stupid mistakes.

Thanks very much.
Mr. Kapsicum
Mr. Kapsicum
Hall of Fame
Hall of Fame (3.8K reputation)Hall of Fame (3.8K reputation)Hall of Fame (3.8K reputation)Hall of Fame (3.8K reputation)Hall of Fame (3.8K reputation)Hall of Fame (3.8K reputation)Hall of Fame (3.8K reputation)Hall of Fame (3.8K reputation)

Group: General Forum Members
Points: 3786 Visits: 1061
maintain your hourly backup in different files.

And size do depend on the transactions that is going in intermediate hour. :-)

and rest, the masters (like Gail,, grant Etc. )have themselves provided some great explanations. Follow Them.
Beatrix Kiddo
Beatrix Kiddo
SSCoach
SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)

Group: General Forum Members
Points: 16437 Visits: 5678
[b]Write your backup statement so that each time the backup runs it backs up to a new file, easiest way is to stamp the date and time into the file name.


Me again. I'm trying to take this advice, and timestamp my backup files.

I did a search and found some help on this site here.

But my own version of it (below) brings back an error message.


declare @backupfile nvarchar(2000)

set @backupfile = N'E:\path\databasename_LOG_BACKUP_' + replace(convert(nvarchar(50), getdate(), 120), ' ',':') + N'.trn'

BACKUP LOG [databasename] TO DISK = @backupfile



The error message:

Msg 3201, Level 16, State 1, Line 6
Cannot open backup device 'E:\path\databasename_LOG_BACKUP_2013-09-18:13:04:40.trn'. Operating system error 123(failed to retrieve text for this error. Reason: 15105).
Msg 3013, Level 16, State 1, Line 6
BACKUP LOG is terminating abnormally.


Googling suggests that this is a permissions issue, but I can backup to E:\path\databasename_LOG_BACKUP etc. using the GUI, so does that mean it's not a permissions issue?

(I also thought it might be a space issue but there is absolutely tons of space on the E drive.)

Thanks again.
Beatrix Kiddo
Beatrix Kiddo
SSCoach
SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)

Group: General Forum Members
Points: 16437 Visits: 5678
... also the SQL Server Service Account is in the Administrators' group on the server.
Grant Fritchey
Grant Fritchey
SSC Guru
SSC Guru (223K reputation)SSC Guru (223K reputation)SSC Guru (223K reputation)SSC Guru (223K reputation)SSC Guru (223K reputation)SSC Guru (223K reputation)SSC Guru (223K reputation)SSC Guru (223K reputation)

Group: General Forum Members
Points: 223883 Visits: 33569
Beatrix Kiddo (9/18/2013)
... also the SQL Server Service Account is in the Administrators' group on the server.


The Agent can be running under a different account. Check that.

----------------------------------------------------
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
Beatrix Kiddo
Beatrix Kiddo
SSCoach
SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)

Group: General Forum Members
Points: 16437 Visits: 5678
Thanks- I did check that, sorry not to be clear!

Ok, when I comment out

+ replace(convert(nvarchar(50), getdate(), 120), ' ',':') + N'.trn'



it works. Huh?
Beatrix Kiddo
Beatrix Kiddo
SSCoach
SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)

Group: General Forum Members
Points: 16437 Visits: 5678
Ok, I changed it to
+ REPLACE(REPLACE(REPLACE(CONVERT(varchar,GETDATE(), 20),'-',''),':',''),' ','') + '.

(also on that thread I linked to)

instead, and now it works Cool. So I will have a series of smallish log backup files, rather than one continually growing one, is that right?
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