Subject Re: [firebird-support] About nbackup
Author Dmitry Kuzmenko
Hello, Vander!

Sunday, December 25, 2011, 10:57:32 PM, you wrote:

VCS> for exemple i see that during the backup, the database file is locked
VCS> and all write are done in a separate delta file ... is this can slow
VCS> down the server ?
VCS> especially when the separate file is merge back with
VCS> the database file ?
Sure, because while writes goes to delta is ok, copying or scanning
database for nbackup levels produces additional IO.

VCS> what happen if for exemple we increase the width of
VCS> one varchar column during the backup ?
bad question.

VCS> also i not understand the level strategy, in the doc they say we will
VCS> rarelly go beyong level 3 or 4 but me what i want to do is to save on a
VCS> daily basis ... so for me it's will be 30 levels min (because every
VCS> month i will reset)... what wrong in this ?

30 levels is nonsense. Also I doubt that nbackup can handle
command line with 30 files specified.
Level 0 - full copy of DB.
Level 1 - only pages that was changed from level 0
Level 2 - only pages that was changed from level 1
etc.

So, it's like snapshot that you make in time.
For example, Level 0 - each month, level 1 - each week, and level 2 -
each day.
Thus with only 3 levels (from 0 to 2) you can restore copy of the
database for each day. Levels goes this way:
0
-1
--2 - pages that changed from level 1
-1 - again, only pages changed from making level 0
--2 - only pages changed from level 1

So, you can combine some level 2 only with level 1 made before it, not
after, of course.
Creating such "a ladder" with 30 levels doesn't make any sense,
because on restore database can be combined with levels down from
highest, i.e. 2+1+0 in that example.
As you plan to make each day 1 level plus, you will need for example
at 15-th day to specify all 15 levels you made. Instead,
you can make level 1 backup each day, and then use level 0+1 to
restore database for particular day starting from the current month.

Depending of the application activity, each level will have different
size. It is hard to predict level sizes, because applications can
rewrite same data, or different data.

So, here is IO also. Using 30 levels needs to apply them all, one by
one to the level 0 backup.

And, remember, that nbackup makes physical copy of the database,
page by page, and it is not interested about data or transaction
numbers, etc.

You can make level 0 copy of the database if you just stop the
Firebird and copy database to another file.


VCS> and to finish how nbackup can know what was changed from the last backup
VCS> ?

see above.

VCS> does it's mean that every page in the database file have a version
VCS> number ?

It starts to have marks after each level of nbackup you make.
That is how nbackup understands what pages was changed from the
last nbackup level made.

--
Dmitry Kuzmenko, www.ib-aid.com