Skip to Main Content

Breadcrumb

May 4th

Question and Answer

Connor McDonald

Thanks for the question, Tapas.

Asked: July 24, 2018 - 10:26 pm UTC

Last updated: July 27, 2018 - 3:14 am UTC

Version: 12.1

Viewed 1000+ times

You Asked

Hi,

I have few clarifications needed regarding RMAN.

1. During Incremental RMAN backup - How does Oracle handles the uncommitted transactions?

2. If a backup is running for a long time (10-20 hrs) - How Oracle handles the backup process - what happens to the transactions which are started when backup started and did completed by the time finished?

3. What are scenarios where - SCN Based incremental backup does not work, Sequence based backup will not work and time based backup will not work?

If you can direct me to some online article - where a great deal of RMAN internals are discussed, I am happy to review those.


Regds
TG

and Connor said...

RMAN or otherwise, what *really* matters is the redo logs. At all times (whether during a backup or not) the datafiles can be thought of as a "fuzzy" representation of the current state of the database. That is because we don't write the datafiles every time you do a transaction - that would be inefficient.

So from time to time we make sure the datafiles are relatively up to date with "reality". The redo logs are a different story - they are the 100% definition of what has happened on your database.

So yes, when you backup the datafiles you are getting an imprecise representation of the database, simply because as you've noted, a backup takes time to run. But during *recovery* we can fix that imprecision using the redo logs (either current or the ones we have backed up). They will NOT be imprecise because we backup the *archived* redo which is no longer being actively changed by the database.

Lets say at 11am we recover a datafile that was backed up at 9am. So each block in that datafile probably represents a point in time *near* to 9am but not precisely at 9am.

So as we recover, the first block might be (say) accurate to 8:58am - we'll can use the redo from that point, to roll that block forward. The next block might be accurate to 8:59am - we'll can use the redo from that point, to roll that block forward, and so forth. Each block might have a slightly different *starting* point, but using the redo we can roll them all forward to common *end* point (10am or whatever we specify).

Of course, when I reference "time of day" in the above, that is really synonymous with SCN. Each block has different SCN's in the backed up datafile, but I can use redo to bring them forward to a common SCN and hence my database becomes consistent.

Once consistent though - some those blocks might contain data from uncommitted transactions. That's ok, because I have also brought *undo* tablespace to that consistent point in the time as well. So in there, I have the information I need to rollback those uncommitted transactions.

Rating

  (1 rating)

Is this answer out of date? If it is, please let us know via a Comment

Comments

online backup

Jeff, July 27, 2018 - 8:49 pm UTC

One of the points I always make when explaining online backups is that the important time is not when the backup begins, it's when the backup ends.

If I start a backup at 8 PM and it finishes at 10 PM, I can restore the backup and roll forward to anytime *after* 10 PM, but I can't restore the full database to 9:30 PM.

More to Explore

Backup/Recovery

Check out the complete guide to all of the Backup & Recovery techniques in the Oracle Database.