Tuesday, March 27, 2012

Backup fail

Hi All,
I have a basic DB backup question:
I make DB backups every day at night using maintenance plan, where all DB
are saved. In 1st step the database backup is made, in 2nd step the
transaction log is saved. Sometimes, usually once a week (e.g. on Monday
1.00 am), one of the database backups failed with "... failed because DB log
is full" error. Now I make a manual backup, which is normally proceeded.
Then, the next backups work normally approx. 1 week. Situation repeates, but
not exactly every week.
After the log backup, I think it will truncate to small size. It is not
true, usual size of log is about 130 MB (database size is 80 MB). But after
a backup failes, the log size is about 270 MB.
In backup parameters the log truncate option is included, but in maintenance
plan this option is missing. So if I'll make backups manually, no problems
will occur. But I want work automatically.
What am I do to correct backup job?
Thank you in advance for your help
Vlastik
Are you saying that you only do log backup once a week? If so, I suggest you do it more frequently. I
generally do db backup once a day and log backup one per hour.
Also, log backup only empties the log file, it doesn't shrink the file. If you have autoshrink on, then the
background process can shrink the file after the log is emptied. Or, your job does an explicit shrink using
DBCC SHRINKDB or DBCC SHRINKFILE. However, there are disadvantages with shrinking the files, see:
http://www.karaszi.com/sqlserver/info_dont_shrink.asp
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
"greybeard" <bartos@.spsmvbr.cz> wrote in message news:%23N3PuRpMEHA.3940@.tk2msftngp13.phx.gbl...
> Hi All,
> I have a basic DB backup question:
> I make DB backups every day at night using maintenance plan, where all DB
> are saved. In 1st step the database backup is made, in 2nd step the
> transaction log is saved. Sometimes, usually once a week (e.g. on Monday
> 1.00 am), one of the database backups failed with "... failed because DB log
> is full" error. Now I make a manual backup, which is normally proceeded.
> Then, the next backups work normally approx. 1 week. Situation repeates, but
> not exactly every week.
> After the log backup, I think it will truncate to small size. It is not
> true, usual size of log is about 130 MB (database size is 80 MB). But after
> a backup failes, the log size is about 270 MB.
> In backup parameters the log truncate option is included, but in maintenance
> plan this option is missing. So if I'll make backups manually, no problems
> will occur. But I want work automatically.
> What am I do to correct backup job?
> Thank you in advance for your help
> Vlastik
>
>
|||Hi, Tibor,
thank you for your response, it helps me to understand some functions of SQL 2000. Of course I've made both data and log backups daily, but something in them doesn't work.
Atfer your response, I checked the settings of my DBs and all settings are O.K. including autoshrink. I've only added a scheduled shrink daily after backup, because an automatic shrink didn't work and I don't know why. For example today, after backups and autoshrink, the database and log size were 112/149 MB. I made manual shrink and sizes changed to 84/41 MB. It's really crazy.
I checked the plan history in [msdb], but I'm not pretty enough to understand it. Database shrink was done every day. Here is a selection for database 'Kredit', which is the biggest:
database_name ;activity ;succeeded ;end_time ;error_number
Kredit ;Backup database ;False ;26.4.2004 1:00:09 ;9002
Kredit ;Backup transaction log ;True ;26.4.2004 1:31:00 ;0
Kredit ;Verify Backup ;True ;26.4.2004 1:31:22 ;0
Kredit ;Rebuild Indexes ;True ;26.4.2004 2:01:43 ;0
Kredit ;Shrink Database ;True ;26.4.2004 2:01:59 ;0
Kredit ;Backup database ;True ;27.4.2004 1:00:37 ;0
Kredit ;Verify Backup ;True ;27.4.2004 1:00:48 ;0
Kredit ;Backup transaction log ;True ;27.4.2004 1:30:49 ;0
Kredit ;Verify Backup ;True ;27.4.2004 1:31:07 ;0
Kredit ;Rebuild Indexes ;True ;27.4.2004 2:01:41 ;0
Kredit ;Shrink Database ;True ;27.4.2004 2:01:57 ;0
Kredit ;Backup database ;True ;28.4.2004 1:00:35 ;0
Kredit ;Verify Backup ;True ;28.4.2004 1:00:45 ;0
Kredit ;Backup transaction log ;True ;28.4.2004 1:30:45 ;0
Kredit ;Verify Backup ;True ;28.4.2004 1:31:00 ;0
Kredit ;Rebuild Indexes ;True ;28.4.2004 2:01:42 ;0
Kredit ;Shrink Database ;True ;28.4.2004 2:01:59 ;0
Kredit ;Backup database ;True ;29.4.2004 1:00:35 ;0
Kredit ;Verify Backup ;True ;29.4.2004 1:00:45 ;0
Kredit ;Backup transaction log ;True ;29.4.2004 1:30:43 ;0
Kredit ;Verify Backup ;True ;29.4.2004 1:30:59 ;0
Kredit ;Rebuild Indexes ;True ;29.4.2004 2:01:42 ;0
Kredit ;Shrink Database ;True ;29.4.2004 2:01:57 ;0
Kredit ;Backup database ;True ;30.4.2004 1:00:37 ;0
Kredit ;Verify Backup ;True ;30.4.2004 1:00:48 ;0
Kredit ;Backup transaction log ;True ;30.4.2004 1:30:45 ;0
Kredit ;Verify Backup ;True ;30.4.2004 1:31:00 ;0
Kredit ;Rebuild Indexes ;True ;30.4.2004 2:01:48 ;0
Kredit ;Shrink Database ;True ;30.4.2004 2:02:04 ;0
Kredit ;Backup database ;False ;3.5.2004 1:00:11 ;9002
Kredit ;Backup transaction log ;True ;3.5.2004 1:31:01 ;0
Kredit ;Verify Backup ;True ;3.5.2004 1:31:24 ;0
Kredit ;Rebuild Indexes ;True ;3.5.2004 2:01:41 ;0
Kredit ;Shrink Database ;True ;3.5.2004 2:01:58 ;0
Note, than there is no reason for failing backup on Mondays, sometimes it fails on another day. From Friday 19:00 to Monday, 5:00, no DB activity is performed.
On the disks, there is enough space for all backup files and a half disk is permanently free.
After these corrections, I hope it'll go better.
Thanks once more, tomorrow I'll write, how it continues.
Best regards, Vlastik
"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> pe v diskusnm pspvku news:%23DiHakrMEHA.2592@.tk2msftngp13.phx.gbl...
> Are you saying that you only do log backup once a week? If so, I suggest you do it more frequently. I
> generally do db backup once a day and log backup one per hour.
> Also, log backup only empties the log file, it doesn't shrink the file. If you have autoshrink on, then the
> background process can shrink the file after the log is emptied. Or, your job does an explicit shrink using
> DBCC SHRINKDB or DBCC SHRINKFILE. However, there are disadvantages with shrinking the files, see:
> http://www.karaszi.com/sqlserver/info_dont_shrink.asp
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
>
> "greybeard" <bartos@.spsmvbr.cz> wrote in message news:%23N3PuRpMEHA.3940@.tk2msftngp13.phx.gbl...
>
|||Bad results.
Today the backup was proceeded normally, but database wasn't shrunk. After
2nd manual backups and shrinking the "empty" log has 142 MB!
|||Did you check the VLF layout? (See the article I referred to.)
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
"greybeard" <bartos@.spsmvbr.cz> wrote in message news:e7YTqu%23MEHA.3016@.tk2msftngp13.phx.gbl...
> Bad results.
> Today the backup was proceeded normally, but database wasn't shrunk. After
> 2nd manual backups and shrinking the "empty" log has 142 MB!
>
>
|||It's incredible! After 3rd manual backup and shrinking the log has
"compressed" to 8MB.
The VLF layout shows now 22 blocks, where 1st, 3rd and 22th are in use. Now
it's O.K., because shrink setting is to leave 10% of free blocks.
Why can't this work automatically and in the first try?
So, I'll try to make backups more often. Perhaps it helps.
Thank you a lot.
Rgds, Vlastik
"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> pe v
diskusnm pspvku news:%23$MLkU$MEHA.2388@.TK2MSFTNGP09.phx.gbl...
> Did you check the VLF layout? (See the article I referred to.)
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
>
> "greybeard" <bartos@.spsmvbr.cz> wrote in message
news:e7YTqu%23MEHA.3016@.tk2msftngp13.phx.gbl...[vbcol=seagreen]
After
>
|||So, after some experiments, I've written my own program for DB backup, which
works with all database files, save and shrink them as I need. It works
fine. It's the only thing, what I've had to do before my holidays.
My program makes backup and than shrinks the trnsact. log so many times,
till its size remains constant. May be it is strange, but it works. Because
this backups is done at 0:30, I'm not afraid of complications.
Thanks for your tips, I've read all, but I wasn't satisfied with this.
Best regards
Vlastik
"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> pe v
diskusnm pspvku news:%23$MLkU$MEHA.2388@.TK2MSFTNGP09.phx.gbl...
> Did you check the VLF layout? (See the article I referred to.)
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
>
> "greybeard" <bartos@.spsmvbr.cz> wrote in message
news:e7YTqu%23MEHA.3016@.tk2msftngp13.phx.gbl...[vbcol=seagreen]
After
>
sql

No comments:

Post a Comment