Oracle introduced the Active Dataguard option in 11g, to allow customers to have read-only access to the physical standby databases. This option gives customers the flexibility to offload resource intensive queries to the physical standby database, while the log shipping and apply continues its work.
In oracle 10g in order to run queries on database tables, in a physical standby database, one had to stop the log apply and open the database in read-only mode. This means that the log files are being queued up during that period and will have to be applied once the database is reverted to the managed recovery mode.
The steps to follow in order to setup Active dataguard are exactly the same as setting up a physical standby database (Creating a Physical Standby). Once the physical standby database is configured and log transport and log apply are working correctly, you can just do an “alter database open” to enable active dataguard.
Let us look at an example.
I have a primary database RK01 and a regualar physical standby database RK01DG.
If you try to query the table emp while the database is in managed recovery mode you will get an error
Make sure that you can update the table emp from the primary database.
In order to enable Active Dataguard, ie enable the ability to query the database while log apply is in progress. Issue the following commands
The main concept to note here is that you are doing a “alter database open” (As opposed to an “alter database open read only”).
Update the table emp again to check if the values you are updating to on the primary are query able on the standby (ie log apply is continuing)
Check the updated value on the standby
Try updating the emp table on the standby database (It should only allow you to query , not update)
The procedure’s to switchover and failover remain exactly the same as before (Irrespective of whether you are in active dataguard mode or not).