On Active Dataguard

One of the real advantages of Oracle Open World is that there are swarms of Oracle employees in attendance who have real intimate knowledge of various pieces of the software and how internally various bits of the Oracle software actually works.

In the exhibition hall there was a huge section with lots of different Oracle stands focusing on various features and on one of the days I dropped by the Active Dataguard booth and had a chat to one of the guys there.

So in terms of how you switch on active dataguard, it’s really not that hard. You just need to have opened your standby read only (which you can do without 11g) and then issue the familiar alter database recover managed standby command – the difference is with 11g you can issue this command to apply the redo while the database open read only and servicing application queries, previously the standby had to be at the mount stage.

So that seems like a small change and in fact such a little change on the surface tends to lead to some lousy presentations as there is very little, at first glance, to say about active dataguard. However underneath the covers a lot of work went on to enable this, it was not just a case of allowing the recover command to be run with the database open.

Database changes that are stored in the redo stream are not ordered and when performing managed recovery those changes are applied to the database out of order and this is done for performance reasons, trying to reorder the changes into the correct sequence would not be performant.

This is no good for queries though, as they need to see a read consistent point of view and with active dataguard this is a constantly moving target. So one of the challenges with active dataguard was to ensure consistent reads were still implemented.

So there is the concept of a published Read SCN which queries are consistent up to and this is behind where the apply process has actually applied redo up to.

Work was also required with dropped packages – you can’t have a package becoming unavailable when the query executing at an earlier read scn actually requires the package. This required changes to the redo stream so that package changes are buffered until the read scn is bumped up.

I also asked a couple of Oracle guys if there was any chance of this being backported to 10g, Larry Carpenter just laughed and said that was one of the first questions he asked. Seems like the changes to the redo stream are so significant that it will never see the light of day in 10g.


4 thoughts on “On Active Dataguard

  1. Hi Jason,
    Do you have any information how Active dataguard solves the redo-problem (read consistency)?
    Do they manage their own redo information or what’s the magic to avoid an ORA-1555?
    I have not ever tested it, so the questions are born of pure curiosity.

  2. Hi Jason,

    another very good post of yours! I have been puzzled for a long time about the internals of active dataguard and why it was only available in 11g.. Your explanation puts some light on it. Do you have any further clues of what additional structures are there in the redo log stream in 11g to implement this?


  3. Hello Martin,

    Thanks for reading!

    As far as I can see it is using 2 different SCN’s the read (or query) scn that provides a consistent view where all transactions up to that point have been applied, and the update SCN that may have transactions applied that were after (on the primary) transactions that have not been applied.


  4. Hello Luca,

    Thanks for those kind words! 🙂

    I’m afraid, this article may be more sauce than meat for you!

    I’ve seen oracle employees present on this, and they give less information than above! I don’t have any further info on the redo stream, i’m afraid.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s