How does an online backup work

doom1701

Member
This has been one of those stupid questions keeping me awake at night. And while every DBMS that supports online backups probably works the same way, the smartest DBMS people I know are here. :)

Anyway, when I run an online backup of our ERP system database, what is really getting backed up? If I start my backup at 10pm, and the backup takes until 10:15pm, and the database is constantly being modified, is the resulting backup of the data from 10:15, 10pm, or somewhere in between?
 

tamhas

ProgressTalk.com Sponsor
The backup will be as of 10pm. It takes a snapshot of the BI ... which you may perceive as a pause at the start of the session, and then as it goes along, before it lets any disk update modify the disk image from where you started, it takes a copy before the change so that is is all consistent as of the start.
 

RealHeavyDude

Well-Known Member
To add to it:

Generally the online is backing up the database blocks in sequential order. As soon as a database block is due for modification which has not been backed up the following happens:
  • The online backup suspends the modification
  • Jumps to that block and writes it into the backup
  • The modification goes through and the online backup jumps back to where it was before
When it then reaches such a block the online backup knows that it has already been backed up and skips it.

Therefore you get a snapshot of the database with a time stamp of the beginning of the online backup.

HTH, RealHeavyDude.
 
Top