Consultor Eletrônico



Kbase P6572: Why incremental backups with -io might decrease in size
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   18/10/2007
Status: Verified

GOAL:

Why incremental backups with -io might decrease in size

GOAL:

How the overlap factor (-io) works with incremental probkup

FIX:

An incremental backup saves the data that has changed since the last full or incremental backup was performed. This is useful because it often takes less time and media to back up the database this way. When -io is specified, then this means that a certain amount of overlap is introduced into the incremental backups. From these two facts it could be thought that this must mean that the size of the incremental backup must increase over time. This seems to make sense - after all, if the the first incremental backup is, say, 20MB, and then you make another 20MB worth of changes in the db, the thinking is that if you have -io specified then the next incremental must be something like 40MB, to take account of all the changes.

This is incorrect, however. The size of the incremental backup will vary. In the Progress database, the master block and every database block contains a backup counter. The counter in the master block is incremented each time the database is backed up with an on-line, off-line, full, or incremental backup. When a database block is modified, PROGRESS copies the backup counter in the master block to the backup counter in the modified database block. When you perform an incremental backup, PROBKUP backs up every database block where the counter is greater than or equal to the master block counter. If you specified the Overlap (-io) parameter, PROBKUP backs up every database block where the counter is greater than or equal to the master block counter, less the overlap value you specify.

So when -io is specified, some blocks that were in a previous incremental might be not included in the next one, and there might not be so many new ones - with the result that the new incremental backup will be smaller in size than the previous one.

Here is a simple illustration of the process. It leaves out detailed considerations - for instance, each backup will contain at a minimum the Master Block (which has changed because of the information Incremental Backup Date and Incremental Backup Sequence) and certainly blocks with information on the data area(s) - but it nevertheless illustrates the general principles.

Assume that a full backup has already been made to facilitate the process of incremental backups. Ignore the fact that an incremental backup wouldn't actually start off containing /only/ 5 blocks that are used as an example here.

1. probkup test testbak1 incremental -io 2
For the sake of argument, let's say that this incremental backs up 5 database blocks.

2. Users now continue working, but only 1 block is updated in this period (it is admittedly a very very simple illustration of the process). This block isn't one of the previous 5 blocks.

3. probkup test testbak2 incremental -io 2
This must backup 5 blocks (for the overlap) + the blocks that were updated since then. So 6 database blocks are backed up.

4. Users continue working, but only 2 blocks are updated in this period. These blocks aren't any of the previous 6 blocks.

5. probkup test testbak3 incremental -io 2
This backs up 5 blocks + 1 + 2 = 8 blocks.

6. Users continue working, but only 3 blocks are updated in this period.
These blocks aren't any of the previous 8 blocks.

7. probkup test testbak4 incremental -io 2
This incremental backup no longer needs to backup the 5 blocks from step 1, because the overlap factor (-io) is only 2. We only need to backup the blocks that have changed since the last incremental backup, plus the blocks that were included in the previous two incremental backups. In other words, the backup this time is 1 + 2 + 3 = 6 blocks, 2 blocks less than the previous incremental backup.

The idea of this example is to show the sequence of events, and there is of course a lot more going on from the point of view of database internals.

In turn, when you restore incremental backups, they must be applied in chronological order to a restored copy. of a full backup of the database. Once the database has had another FULL probkup taken, the counter in the masterblock is reset and the incremental backups are counted from that point.

However, when you use the -io option, this allows you to decrease the number of incremental backups which must be applied to your restored database. In the above example, where -io = 2, then you only need to apply every 2nd incremental backup to your restored database, as these include all the changes that were made to the database in the preceding four increments. -io is cumulative..